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/gst-return-reconcile

v0.1.0

Published

Match purchases with GSTR-2B, work out claimable input credit, and build a GSTR-3B worksheet.

Readme

@zenuinebit/gst-return-reconcile

From purchases to a return: read a GSTR-2B download, match it with your purchase register, work out the input credit the filing supports, and lay out a GSTR-3B style worksheet. Builds on @zenuinebit/purchase-gst. Amounts are integers in minor units (paise); dates are "YYYY-MM-DD".

Review everything. The GSTR-2B reader follows the portal's JSON as commonly documented (data.docdata.b2b and cdnr), and that format changes over time, so check it against a real download. Which credit may be claimed is decided by GST law, not by this package. Treat the results as working figures to go through with your accountant.

import { parseGstr2b, reconcileWith2B, gstr3bWorksheet } from "@zenuinebit/gst-return-reconcile";
import { computePurchase } from "@zenuinebit/purchase-gst";
import { generateReport } from "@zenuinebit/gst-report";

const books = purchases.map((p) => computePurchase(p, "27AAPFU0939F1ZV"));   // your register
const twoB = parseGstr2b(await fs.readFile("GSTR2B_042025.json", "utf8"));

const rec = reconcileWith2B(books, twoB, { tolerance: 100 });     // differences up to 1.00 still match
rec.matched; rec.mismatched; rec.missingInSupplierFiling; rec.missingInBooks;     // as in purchase-gst
rec.credit.booked;            // eligible credit in your register, per head (cgst, sgst, igst)
rec.credit.supported;         // the part the supplier filing backs up
rec.credit.atRisk;            // booked - supported
rec.credit.unbookedAvailable; // in 2B and marked available, but not in your books: maybe a forgotten entry
rec.credit.notes;             // supplier credit notes (lower) and debit notes (raise), net
rec.credit.blockedByPortal;   // invoices the portal marks "ITC not available"

const sales = generateReport(invoices, { supplier: "27AAPFU0939F1ZV" });
const sheet = gstr3bWorksheet({
  outward: sales.totals,
  itcClaimed: rec.credit.supported,          // or whatever you decide to claim
  itcReversed: { cgst: 0, sgst: 0, igst: 0 },
  openingCredit: lastMonth.carryForward,
});
sheet.cashPayable; sheet.totalCashPayable; sheet.carryForward;

How it works

  • parseGstr2b accepts the JSON object or its text. Invoice amounts are summed from the items; rupees become minor units; dd-mm-yyyy dates become ISO. Invoices the portal marks itcavl: "N" are flagged.
  • reconcileWith2B uses the matching in purchase-gst (supplier GSTIN plus invoice number, ignoring case and punctuation). The credit it counts as supported is the lower of your booked credit and the filed tax for each head, and zero for invoices the portal marks as not available.
  • gstr3bWorksheet sets credit off the usual way: IGST credit first (against IGST, then CGST, then SGST), then CGST credit (against CGST, then IGST), then SGST credit (against SGST, then IGST). Credit used plus credit carried forward always equals credit available.

Not included: imports, ISD and reverse-charge sections of 2B, amended invoices, interest and late fees, the exact GSTR-3B table layout and JSON, GSTR-1 versus books comparison, and any rule about which credit is blocked or must be reversed.