Giter Club home page Giter Club logo

jsreport-cli'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 update vulnerable jsreport dependencies based on npm and Snyk audits during every release. Please wait until we release the next version when you notice 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) 2024 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-cli's People

Contributors

ai avatar bjrmatos avatar oeon avatar pofider avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

uwascan

jsreport-cli's Issues

preserve original instance configuration after server reboot (Windows Service)

user was reporting (via email) that he started jsreport's windows service using:

node server install โ€“-httpPort=4998

and server started on 4998 normally, but after a reboot the server was not using that port (i guess jsreport used the default port 5488). this is due to not preserving the original instance configuration when creating the windows service (we should check that custom args are preserved too).

i see two solutions for this:

  • before creating the windows service, initialize a jsreport instance and read the configuration in there, then pass those configuration values as ENV vars to the windows service (also ensuring that custom args are being recognized by nssm), that will ensure that when restarting the service the initial configuration will be applied.

  • pass new --config path/to/current-config arg to windows service (also ensuring that custom args are being recognized by nssm)

i prefer the first one because it ensures all exact configuration is applied (because it will have all config parsed by nconf)

The path to the sockets directory should be configurable

The socket files are currently stored in the home directory of the current user.
Unfortunately IIS default user has no access to its home directory so the jsreport exe doesn't work there.

There needs to be at least a configurable way to store the sockets somewhere else, perhaps in temp directory.

use new windowsHide child process option instead of silent-spawn dep

before node 8.8.0, child processes (detached) on windows generated a new cmd window, this was annoying for background tasks. so for our case we had to build silent-spawn to support older versions. in jsreport v2 is likely that we just use windowsHide instead of silent-spawn, we just need to test that windowsHide works normally.

Update Dependencies

When installing globally via npm install jsreport-cli -g I get the following warnings:

npm WARN deprecated [email protected]: Use uuid module instead
npm WARN deprecated [email protected]: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130

Not really a huge issue, but it states that the event loop can block for a long periods of time under certain regular expressions in tough-cookie, and node-uuid is deprecated.

improve the jsreport help config

some ideas taken from internal discussion about future improvements of jsreport help config

  • jsreport help config [subsection of config] -> prints only relevant schema for the subsection

  • what do to do when the generated schema output is too long? one idea is to just save the output in one file so user can read it normally in some editor without limitations of command line window

Speed up unit tests

The current unit tests takes too much time, it is too disturbing to run them during the development.
Also the windows service tests doesn't work on my local.

It would be probably better to have two collections of tests. One light and fast which we run on local and one heavy which can run only in the CI.

support starting multiple jsreport keepAlive instances when multiple calls tries to start it at the same time

if multiple jsreport render --keepAlive ... are being done at the same time and the background process is not initialized then just one of calls will complete the other will fail with error ..seems like there is already a server running in port 5488. when the background process is initialized all calls will just complete normally, the problem is only visible when the background process is not initialized and multiple calls are being done.

we see two solutions for this:

  • implement some kind of lock
  • add retry when the command fails because specific error about port used

the second one looks more easy to do

Passing options to render command

I would like enable some features of debug extension in render command. This is normally done using options prop in request. However it seems render command doesn't parse it.

c:\Users\janbl\...>jsreport render --template.content=test.html --template.recipe=phantom-pdf --template.engine=none --options.debug.logsToResponse=true --out=out.html
render command error:
Unknown argument: options
type jsreport render -h to get help about usage and available options

New argument for storing the response meta

I would like that the caller is able to read somewhere the response meta which we normally send through http headers like logs, numberOfPages, contentType....

Proposed format is like this:
jsreport render .... --out-meta=meta.json

However we need to think this through before implementing it....

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.