lil5 / reportsdb

Create reports from SQLite with Pug and JavaScript templates.

Home Page:https://www.npmjs.com/package/reportsdb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitHub license npm XO code style

ReportsDB

Create reports from an sqlite datebase and a template using SQL and Pug with Big.js JavaScript math.

These reports can be rendered in:

  • PDF
  • CSV
  • HTML

Install

$ npm i -g reportsdb

Commands

Help

$ reportsdb -h
$ reportsdb toPDF -h

Create project by copying the example

$ reportsdb init .

This will create a boilerplate on which to work on.

/db.sqlite
/.editorconfig
/files/
/reports/
/scripts/
/scripts/inputFood.sh
/templates/
/templates/Food/
/templates/Food/html.pug
/templates/Food/query.sql

Create report

Generating a report will read the html.pug and query.sql inside the given template directory. Output file is located in reports.

Filtering is possible by year -y <YYYY> (and quater -q <Q>). A --select <column> option is required. The --select option will also reorder by said column date (with or without year (& quater) filter).

PDF

$ reportsdb toPDF ./examples/templates/Food/

CSV

$ reportsdb toCSV ./examples/templates/Food/

HTML

$ reportsdb toHTML ./examples/templates/Food/

About

Create reports from SQLite with Pug and JavaScript templates.

https://www.npmjs.com/package/reportsdb

License:MIT License


Languages

Language:JavaScript 98.0%Language:HTML 2.0%