Skip to content

cli to genarate simple invoices from html template

Notifications You must be signed in to change notification settings

janouma/html-invoicer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

html-invoicer

CLI to genarate simple invoices from html template

Install

npm i -g html-invoicer

Usage

invoice --tmpl path/to/template.html --data path/to/data --out path/to/output.pdf --any 12 --kind "of additional" --params possible

Parameters

Parameter Type Required Description
--tmpl String Yes Template: a relative or absolute path to an html file.
Templates can use es6 string interpolation syntax for variables: ${varname}
--data String Yes

Data: a relative or absolute path to a js or json file. A js file can return either an object or a function.

If a js data file exports a function, this function get passed all the command line parameters as an object. The function must then return an object with all the variables needed by the template
--out String Yes Output file: the pdf destination file

Any additional parameters will be passed to the js data function — in case it is actually a function — and can be used to craft the template variables object — as stated before.

A complete example of a template.html file, a data.js file and the resulting invoice.pdf file can be found under the example directory.

About

cli to genarate simple invoices from html template

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published