npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sane-reports

v1.0.4

Published

Reports library that will keep you sane and not pulling your hair out. sane-report is a library that helps you to generate headless reports according to simple language.

Downloads

13

Readme

Sane Reports by Demisto

CircleCI Coverage Status

Reports library that will keep you sane and not pulling your hair out

Quick start

PhantomJS

$ npm install sane-reports
$ cd sane-reports
$ phantomjs reportsServer.js templates/test.json dist/test.pdf

Chromium/Chrome

$ npm install sane-reports
$ npm run make
$ ./reportsServer templates/test.json dist/test.pdf # for linux users.
$ ./reportsServer-macos templates/test.json dist/test.pdf # for macOS users.
$ ./reportsServer-win.exe templates/test.json dist/test.pdf # for windows users.

Report will be generated in: dist/test.pdf

Generating dashboard mode (browser) report

$ git clone [email protected]:demisto/sane-reports.git
$ cd sane-reports
$ npm install
$ npm start

Now open browser at: http://localhost:8082

Generating PDF report

$ git clone [email protected]:demisto/sane-reports.git
$ cd sane-reports
$ npm install
$ npm run production
$ npm run generate-report

This will generate a PDF report in the dist folder. The name of the report will start with report-.

Generate report options:

You can create PDF report with the following command as well:

PhantomJS

phantomjs reportServer.js <report_template_file> [<output_file> <dist_folder> <orientation> <resourceTimeout> <type> <headerLeftImage> <headerRightImage> <customReportType> <pageSize> <disableTopHeaders>]

Chromium/Chrome

./reportsServer <report_template_file> [<output_file> <dist_folder> <orientation> <resourceTimeout> <type> <headerLeftImage> <headerRightImage> <customReportType> <pageSize> <disableTopHeaders> <chromiumPath>]

  • report_template_file: The template of the report (JSON format)
  • output_file: The name of the generated report (leave empty for default name)
  • dist_folder: should be dist
  • orientation: The orientation of the report: portrait/landscape (default portrait)
  • resourceTimeout: Timeout for generating the report (default is 4000ms)
  • type: The report type: pdf or csv (default is pdf)
  • headerLeftImage: The image to show at the left side of the report header of each page (base64 or url)
  • headerRightImage: The image to show at the right side of the report header of each page (base64 or url)
  • customReportType: Custom report type if needed. currently not used.
  • pageSize: The report page size to generate. Possible: A4, A3, A5, letter (default A4).
  • disableTopHeaders: true or "true" to disable the top headers and show icons in the footer. (default false)
  • chromiumPath: a custom chromium or chrome path. The service searches for installed chromium or chrome by order. Default usage by priority: Chromium -> Google Chrome Stable -> Google Chrome -> the default path '/usr/bin/chromium-browser'.

PDF Example:

phantomjs reportsServer.js templates/test.json dist/test.pdf dist portrait 4000 pdf ./reportsServer templates/test.json dist/test.pdf dist portrait 4000 pdf

CSV Example:

phantomjs reportsServer.js templates/testCSV.json dist/test.csv dist portrait 4000 csv ./reportsServer templates/testCSV.json dist/test.csv dist portrait 4000 csv

Demo

Reports templates (JSON) examples can be found in the templates folder.

Example reports outputs can be found in the examples folder.

Create your own report template

You can edit existing report templates or create your own template. Report templates are created in JSON format and includes sections. Sections are ordered according to their row and column positions.

Section types: Header, Divider, Date, Image, JSON, Markdown, Table, Text, Bar Chart, Line Chart, Pie Chart

Each section can have its own style (camled case css style: font-size -> fontSize).

License

demisto/sane-reports is licensed under the Apache License 2.0