CLI to genarate simple invoices from html template
npm i -g html-invoicer
invoice --tmpl path/to/template.html --data path/to/data --out path/to/output.pdf --any 12 --kind "of additional" --params possible
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 |
--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, adata.js
file and the resultinginvoice.pdf
file can be found under theexample
directory.