Socket
Book a DemoInstallSign in
Socket

markdown-invoicer

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-invoicer

Invoice PDF generator API

1.0.7
latest
Source
npmnpm
Version published
Weekly downloads
2
-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

invoice-ninja

Simple invoice generator

Note: This module is not related to the PHP/Laravel invoicing site Invoice Ninja or its GitHub repository.

Getting Started

npm install invoice-ninja

Example Usage

var fs = require('fs');
var Invoice = require('./index.js');

today = new Date();
due = new Date()
due.setDate(today.getDate() + 14);

input = {
  currencyFormat: "£%d",
  invoice_number: 1421,
  date_now: today.toDateString(),
  date_due: due.toDateString(),
  from_name: 'nCrazed',
  client_name: 'Client Inc.',
  items: [
    {
      description: 'Freebie',
      quantity: 1,
      rate: 0,
      amount: 0
    }
  ]
};

var invoice = new Invoice();
invoice.generatePDFStream(input).pipe(fs.createWriteStream('invoice.pdf'));

The above code would create a pdf file that looks like this: Example result

Options

Optional absolute paths to your custom template and/or css files.

options.baseTemplate

Type: String

Default: template.md

options.rowTemplate

Type: String

Default: row.md

options.cssPath

Type: String

Default: bootstrap.css

Input

All but currencyFormat are optional.

input.currencyFormat

Type: String

Format string for currency values. It's passed to util.format as the first argument and should include the currency symbol and the %d placeholder.

input.invoice_number

Type: String

input.date_now

Type: String

input.date_due

Type: String

input.subtotal

Type: Number

input.tax

Type: Number

input.shipping

Type: Number

input.paid

Type: Number

input.balance

Type: Number

input.from_name

Type: String

input.from_street

Type: String

input.from_city

Type: String

input.from_county

Type: String

input.from_post_code

Type: String

input.from_country

Type: String

input.client_name

Type: String

input.client_street

Type: String

input.client_city

Type: String

input.client_county

Type: String

input.client_post_code

Type: String

input.client_country

Type: String

input.items

Type: Array

Each element of the array represent a single item.

input.items.description

Type: String

input.items.quantity

Type: String

input.items.rate

Type: Number

input.items.amount

Type: Number

Keywords

invoice

FAQs

Package last updated on 09 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.