Coder Social home page Coder Social logo

jsreport-fs-store's Introduction

jsreport

Join the chat at https://gitter.im/jsreport/jsreport NPM Version NPM Downloads Docker Pulls build status

An open-source platform for designing and rendering various reports.

jsreport is a reporting server letting developers define reports using javascript templating engines like handlebars. It supports various report output formats like html, pdf, excel, docx, and others. It also includes advanced reporting features like user management, REST API, scheduling, designer, or sending emails.

You can find more information on the official project website https://jsreport.net

studio

Installation

Basic installation from the npm

npm install -g @jsreport/jsreport-cli
jsreport init
jsreport configure
jsreport start

You can also download compiled binary or pull from the official docker images. See https://jsreport.net/on-prem for the details.

Documentation

See the https://jsreport.net/learn for an overview of concepts, guides, clients, and general documentation.

Extensions

The jsreport official distribution in npm, docker, or compiled binary includes the most commonly used extensions. However, the list of available extensions is much longer, and you may want to install some of the missing ones as well. See the list of available packages here or in the documentation.

You are also not limited to extensions we provide to you. You can implement your extensions. See the Implementing custom extension article.

Node.js

You can find documentation for adapting this jsreport distribution using nodejs and also information for integrating it into an existing nodejs application in the article adapting jsreport.

The official jsreport distribution wires the most popular extensions into the ready-to-use package. However, if you are skilled, you are free to start from the ground using jsreport-core.

Development

We use yarn to manage the monorepo. The basic workflow is the following

git clone https://github.com/jsreport/jsreport
yarn install
yarn start

The tests for the individual package runs the following way

yarn workspace @jsreport/jsreport-scripts test

The studio extensions development with the hot reload can be started using

set NODE_ENV=jsreport-development&&yarn start

Roadmap

  • adding more features to docx/pptx/xlsx recipes
  • pdf compression
  • version control extension direct git integration and improvements
  • studio editor intellisense
  • html-to-xlsx - images, filters...

More in the backlog.

Missing a feature? Submit a feature request.

Vulnerabilities

We guarantee every release is stable and has 0 vulnerabilities mentioned in the npm audit. Please wait until we release the next version with the dependencies update when you see a security warning in your audit. There is no need to create a ticket for it. In case you see a direct impact on jsreport security that you can replicate, please send us an email to [email protected] and we will make sure it's fixed ASAP. Note there is no need to panic when there is a vulnerability mentioned in the audit because it is the most likely in the code path that is not used. A typical example of a vulnerability is an eventual DDoS attack through a dependency parsing some internal config, which in fact can't happen and isn't a vulnerability at all.

Licensing

Copyright (C) 2023 Jan Blaha

Do you want to use jsreport for a personal purpose, in a school project or a non-profit organization? Then you don't need the author's permission, just go on and use it. You can use jsreport without the author's permission also when having a maximum 5 templates stored in jsreport storage.

For commercial projects using more than 5 stored report templates see Pricing page.

Under any of the licenses, free or not, you are allowed to download the source code and make your own edits.

In every case, there are no warranties of any kind provided:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

jsreport-fs-store's People

Contributors

bjrmatos avatar pofider avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

bjrmatos pbehnke

jsreport-fs-store's Issues

Auto-discovery extensions with jsreport-core

Hi,

I am testing jsreport-core in order to integrate it to an larger app.
I installed a few extensions, among them jsreport-fs-store.
When I launch it, the output is the following:

info: Initializing [email protected] in development mode
info: Searching for available extensions in /home/pierre/Documentos/Proyectos/tip/jsreportServer/jsreportStandalone/
info: Extensions location cache contains up to date information, skipping crawling in /home/pierre/Documentos/Proyectos/tip/jsreportServer/jsreportStandalone/
info: Found 4 extensions
info: Setting dedicated-process (process based) strategy for rendering. Please visit http://jsreport.net/learn/configuration for information how to get more performance.
info: Using extension [email protected]
info: Using extension [email protected]
info: Using extension [email protected]
info: Using extension [email protected]
info: Using memory provider for template store. The saved templates will be lost after restart
info: reporter initialized
info: Starting rendering request 1 (user: null)
info: Rendering anonymous template { recipe: chrome-pdf, engine: handlebars }
info: Rendering request 1 finished in 552 ms

The script is the following:

const winston = require('winston')
const jsreport = require('jsreport-core')()
jsreport.logger.add(winston.transports.Console, { level: 'info' })
const fs = require('fs')
jsreport.init().then(() => {
	return jsreport.render({
		template: {
			content: '<h1>Hello {{foo}}</h1>',
			engine: 'handlebars',
			recipe: 'chrome-pdf'
		},
		data:{
			foo: 'truc'
		}
	}).then((resp) => {
        resp.result.pipe(fs.createWriteStream('helloWorld.pdf'))
 	});
}).catch((e) => {
	console.error(e)
})

jsreport.config.json:

{
  "httpPort": 5488,
  "allowLocalFilesAccess": true,
  "store": {
    "provider": "fs"
  },
  "blobStorage": {
    "provider": "fs"
  },
  "reportTimeout": 60000,
  "extensions":{
    "fs-store":{
        "syncModifications": true
    }
  }

}

When I manually import the extension, i.e :

jsreport.use(require('jsreport-fs-store')())

the output remains the same (except that it says 'Handlebars' is not defined but it's another subject ;)

I don't see why jsreport is still using the default memory provider. How can I force jsreport to use it ?

Thanks in advance.

Entity name with [foo]

Example:
Reading an entity [FO]hello
The content file is [FO]hello/content.handlebars
We use this glob to find the content file, basically want to ignore the file extension using [FO]hello/content.*.
Unfortunately the [] characters are having a meaning in the glob and the content file is not found then.

We need to fix the glob somehow.

Migration from the nedb store

We need to provide a migration utility or at least a description somewhere how it can be done manually before this store is set as default in the jsreport

Initialize socket.io server only in development or with some configuration

the socket.io server is handy while developing templates, but using it in production is wasting resources because i don't think that changing a template in jsreport studio should modify the template's file content in an app in production.

also, i think allowing to do modifications to templates in a production app from jsreport studio should be avoided, maybe we can disable modifications to templates through a configuration option in jsreport

Possible to customize dir structure?

Wondering if it's possible to use a deeper nested dir structure. Something like data/templates/standard templates/invoice/ and data/templates/custom templates/customer name/invoice

allow autocompaction of nedb database

currently some extensions are storing data very frequently in settings (like jsreport-studio that stores requestsLog and failedRequestsLog) and that is causing some troubles when you have a jsreport process that is running for a long time.

this troubles are created because of how the persistence in nedb works, as described here, nedb uses an append-only format, meaning that all updates and deletes actually result in lines added at the end of the datafile, those lines are compacted (put back in the one-line-per-document format) every time a database is loaded, for jsreport this means that if you are using jsreport-studio extension and you are rendering a lot of templates or you have a jsreport process that is working for a long time, you will end up with a settings file with a lot of data that can cause an out of memory exception, the same goes if for some reason you stop your jsreport process and the next time that you try to start jsreport you will get an error "FATAL ERROR: CALL_AND_RETRY_0 Allocation failed - process out of memory" because nedb will try to load this big settings file.

the solution for this problem is to enable the compaction of nedb databases periodically, with that enabled and some checks and limits that we have in extensions this problem is handled.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.