ez-invoice
v2.0.0
Published
Simple invoice generator
Downloads
8
Readme
Ez Invoice
- A Simple Invoice Generator for starters
How to use
- Creating an Invoice
const { createInvoice } = require("ez-invoice")
const { createWriteStream } = require("fs")
const options = {
storeName: "Fruit Store",
tax: 10,
currency: "$",
paymentMode: "Cash",
location: "XYZ",
invoiceID: "123456"
}
let items = [
{
name: "Apple",
beforeTax: 2
},
{
name: "Banana",
beforeTax: 3
},
]
const invoice = createInvoice(options, items)
invoice.png.pipe(createWriteStream("./invoice.png"))
//or
invoice.jpeg.pipe(createWriteStream("./invoice.jpeg"))
HTML
<head>
<script src="https://cdn.jsdelivr.net/npm/ez-invoice/index.min.js"></script>
<script>
const options = {
storeName: "Fruit Store",
tax: 10,
currency: "$",
paymentMode: "Cash",
location: "XYZ",
invoiceID: "123456"
}
let items = [
{
name: "Apple",
beforeTax: 2
},
{
name: "Banana",
beforeTax: 3
},
]
const invoiceCanvas = createInvoice(options, items)
document.body.appendChild(invoiceCanvas)
</script>
</head>
<body>
</body>