UNPKG

invoice-fs

Version:

Nostalgic command-line invoicing application producing plain text invoices and JSON data structures. Uses the file system as a database

19 lines (16 loc) 345 B
function InvoiceItem(invoice) { this.type = 'invoiceItem'; this.invoice = invoice; this.data = { description: "", units: 1, unitPrice: 0 } } InvoiceItem.prototype.save = function(callback) { this.invoice.add(this.data); if (callback) { callback(); } }; module.exports = InvoiceItem;