Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

falcon-invoice

0.0.4 • Public • Published

falcon-invoice

Generate PDF invoices using HTML templates and mustaches!

Installation

npm install falcon-invoice

Usage

Check out test/index.js for a more detailed example!

const invoice = require('falcon-invoice')
 
const template = '/path/to/template'
const templateVariables = {
  name: 'Herp Derpington'
}
 
// Optional options
const options = {
  filename: 'differentName.pdf',
  pdfOptions: {
    orientation: 'landscape'
  }
}
 
invoice(template, templateVariables, options)

Template Example

<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
  </head>
  <body>
    <p>
      Customer Name: {{name}}
    </p>
  </body>
</html>

Output example

alt text

Credits

This package uses: html-pdf and mustache

I got my test html template from: https://github.com/NextStepWebs/simple-html-invoice-template

install

npm i falcon-invoice

Downloadsweekly downloads

15

version

0.0.4

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability