npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@zenuinebit/eway-bill

v0.1.0

Published

E-way bill JSON payload builder and checks: vehicle number, validity, value threshold.

Readme

@zenuinebit/eway-bill

Builds the JSON for generating an e-way bill from an invoice, and checks the inputs the portal is strict about: GSTINs, PIN codes, HSN codes, vehicle numbers and distance. Builds on @zenuinebit/gst-report and @zenuinebit/address-india.

Check before you rely on it. Field names and codes follow the NIC e-way bill JSON as commonly documented. The portal and the rules (value limit, validity, exemptions) change, and differ by state and goods. Validate the payload with the official tools, and treat the result as plain data you can adjust. It does not replace your accountant.

import { buildEwayBill, toEwayJson, isValidVehicleNumber, validityDays, validUntil, requiresEwayBill } from "@zenuinebit/eway-bill";

const bill = buildEwayBill({
  invoice: {                                   // the same SaleInvoice used by gst-report
    number: "INV/2025-26/0042",
    date: "2025-04-10",
    placeOfSupply: "Karnataka",
    buyer: { gstin: "29ABCPD1234E1ZA", name: "Bengaluru Traders" },
    lines: [{ description: "Tea 250g", hsn: "0902", quantity: 100, unitPrice: 10_000, taxRate: 5 }],
  },
  from: { gstin: "27AAPFU0939F1ZV", name: "ZenuineBit Foods", address1: "1 Main Rd", place: "Pune", pincode: "411001" },
  to:   { gstin: "29ABCPD1234E1ZA", name: "Bengaluru Traders", address1: "5 MG Rd", place: "Bengaluru", pincode: "560001" },
  transport: { distanceKm: 840, vehicleNo: "MH 12 AB 1234" },
  unitByHsn: { "0902": "KGS" },                // unit per HSN, default "NOS"
});

await fs.writeFile("ewb.json", toEwayJson(input));

validityDays(840);                  // 5   (1 day per 200 km for ordinary cargo)
validUntil("2025-04-10", 840);      // "2025-04-15"
requiresEwayBill(7_500_000, 5_000_000);   // you pass your own limit, in minor units

What it does

  • Works out values with the same GST maths as gst-report: CGST+SGST within a state, IGST between states. Values are in rupees, dates dd/MM/yyyy, PIN codes and HSN codes as numbers.
  • fromStateCode comes from the GSTIN. actFromStateCode comes from the state you give for the address, so dispatch from another state is supported. For an unregistered buyer, use gstin: "URP" and give a state.
  • Road transport needs a vehicle number or a transporter GSTIN (Part A only). Rail, air and ship need the transport document number and date.
  • Throws a clear message for a bad GSTIN, PIN, HSN (4 to 8 digits), vehicle number or distance.
  • toBulkJson(inputs, version) wraps several bills; pass the version string the portal currently asks for.

Not included: calling the e-way bill API (authentication, generate, update vehicle, cancel, extend), consolidated e-way bills, cess, other charges and round-off, bill-to/ship-to sub-types beyond the codes you pass, and exemption rules. The value limit is not assumed: pass it to requiresEwayBill.