JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 20
  • Score
    100M100P100Q94964F
  • License MIT

Framework-independent TypeScript billing library for Angular, React, Vue, Node.js and JavaScript projects

Package Exports

  • @awadheshs109/billing

Readme

Zentris Billing

Framework-independent TypeScript billing and invoice generation library for Angular, React, Vue, Node.js and JavaScript applications.

Supports:

✅ GST / Tax calculations
✅ Discount calculations
✅ Currency formatting
✅ Invoice generation
✅ PDF export
✅ CSV export
✅ JSON export
✅ HTML invoice templates
✅ Browser + Node support
✅ CI/CD npm publishing


Installation

npm install @awadheshs109/billing

Quick Start

import { Billing } from "@awadheshs109/billing";

const gst = Billing.calculateGST(1000, 18);

console.log(gst);

//180

Invoice Example

import { InvoiceGenerator } from "@awadheshs109/billing";

const invoice = {
  invoiceNo: "INV-1001",

  date: "21-05-2026",

  company: {
    name: "Zentris Pvt Ltd",

    address: "Mumbai",

    phone: "+91 999999999",
  },

  customer: {
    name: "Awadhesh Sharma",

    company: "Client Company",

    address: "Bangalore",
  },

  items: [
    {
      description: "Angular Development",

      quantity: 5,

      rate: 75,
    },

    {
      description: "Invoice Setup",

      quantity: 2,

      rate: 100,
    },
  ],

  tax: 18,

  discount: 5,
};

Generate HTML Invoice

const html = InvoiceGenerator.toHTML(invoice);

Generate CSV

const csv = InvoiceGenerator.toCSV(invoice);

Generate JSON

const json = InvoiceGenerator.toJSON(invoice);

Generate PDF

const pdf = InvoiceGenerator.toPDF(invoice);

Save PDF in Node

import fs from "fs";

const pdf = InvoiceGenerator.toPDF(invoice);

const buffer = Buffer.from(await pdf.arrayBuffer());

fs.writeFileSync("invoice.pdf", buffer);

Available APIs

Billing

Method Description
calculateGST(amount,tax) Calculate GST
calculateDiscount(amount,discount) Calculate discount
formatCurrency(amount,currency) Currency formatter

InvoiceGenerator

Method Description
toHTML() Generate invoice HTML
toCSV() Export CSV
toJSON() Export JSON
toPDF() Export PDF

Development

Build:

npm run build

Run tests:

npm run test:run

Local invoice validation:

npx tsx test-invoice.ts

Release Process

Version update:

npm version patch --no-git-tag-version

Commit:

git add .
git commit -m "development: add feature"

Tag:

git tag v1.1.0
git push
git push --tags

GitHub Actions automatically:

build
→ test
→ publish npm

Changelog

See:

CHANGELOG.md

License

MIT


Repository

:contentReference[oaicite:0]{index=0}

Package:

:contentReference[oaicite:1]{index=1}