UNPKG

@ryanforever/invoice-generator

Version:

invoice-generator API wrapper

48 lines (38 loc) 830 B
# invoice-generator A wrapper for the API of https://invoice-generator.com Requires an API key. ## quickstart ```javascript const InvoiceGenerator = require("@ryanforever/invoice-generator") const invoice = new InvoiceGenerator({ key: process.env.KEY // key from invoice-generator.com // SET INVOICE DEFAULTS name: "Ryan Forever", address: "1234 Paradise Rd\nHollywood, CA, 94510", phone: "555-555-5555", logo: "https://example.com/my-logo.jpg", }) invoice.generate({ title: "My Invoice", clientName: "Apple, Inc", clientAddress: "One Apple Park Way, Cupertino, California, 95014", fields: { poNumber: "0004501244", }, items: [ { name: "Hard Work", rate: 10000, description: "did alot of hard work" } ] }) /* { invoice: { // invoice details }, data: <Array Buffer to save as PDF> } */ ```