@gst-invoice/gst-invoice
v0.0.1
Published
GST invoice generator, tax calculator, and GSTIN validator
Maintainers
Readme
@gst-invoice/gst-invoice
Lightweight, compliant GST invoice generator, tax computation engine, and GSTIN validator for India.
Features
- Tax Breakdown: Automated computation of CGST, SGST, and IGST for intra-state and inter-state transactions.
- GSTIN Validation: Quick format validation for 15-character Indian GSTIN strings.
- Zero Dependencies: Lightweight, high performance, ES Modules.
Installation
npm install @gst-invoice/gst-invoiceQuick Start
import { calculateGST, isValidGSTIN } from '@gst-invoice/gst-invoice';
// Validate GSTIN
console.log(isValidGSTIN('29ABCDE1234F1Z5')); // true
// Compute GST (Intra-state)
const intra = calculateGST({ taxableAmount: 1000, ratePercent: 18, isInterState: false });
console.log(intra);
// { cgst: 90, sgst: 90, igst: 0, totalTax: 180, totalAmount: 1180 }
// Compute GST (Inter-state)
const inter = calculateGST({ taxableAmount: 1000, ratePercent: 18, isInterState: true });
console.log(inter);
// { cgst: 0, sgst: 0, igst: 180, totalTax: 180, totalAmount: 1180 }License
MIT
