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

@classytic/bd-tax

v0.1.1

Published

Bangladesh tax engine — VAT, SD, TDS, VDS, income tax, Mushak forms, BIN validation, fiscal positions, and NBR return aggregation. Pure calculation library with pluggable account mapping for any ledger system.

Downloads

280

Readme

@classytic/bd-tax

Bangladesh tax engine — VAT, SD, TDS, VDS, income tax, Mushak forms, BIN validation, fiscal positions, and NBR return aggregation.

Pure calculation library. No database, no HTTP framework, no hard dependencies on any ledger system. Composable with any accounting backend (@classytic/ledger-bd, QuickBooks, Xero, ERPNext, or custom).

Install

npm install @classytic/bd-tax

Peer dependency: zod >= 4.0.0.

Use

Prefer subpath imports — each concern is its own entry point.

// VAT and invoice-level calculation
import { calculateVAT, calculateInvoiceTax } from '@classytic/bd-tax/calc';

// Mushak forms and BIN validation
import { buildMushak63, validateBIN } from '@classytic/bd-tax/musok';

// Rate tables and regime config
import { VAT_RATES, TURNOVER_THRESHOLDS } from '@classytic/bd-tax/config';

// Personal income tax (FY2025-26 slabs)
import { computeIncomeTax } from '@classytic/bd-tax/income-tax';

// TDS / VDS withholding matrices
import { calculateTds } from '@classytic/bd-tax/tds';
import { calculateVdsDeduction } from '@classytic/bd-tax/vds';

// Account mapping (ledger-bd chart defaults; override at will)
import { accountFor, createAccountMapper, BD_VAT_ACCOUNT_CODES } from '@classytic/bd-tax/accounts';

The root entry re-exports the most common symbols as a convenience, but subpaths are the canonical way and keep bundles tight.

What's inside

| Subpath | Ships | |---|---| | ./calc | calculateVAT, extractVAT, roundPaisa, calculateSD, calculateSdThenVat, calculateTOT, determineTaxRegime, isTotEligible, calculateLineItem, calculateInvoiceTax | | ./musok | Mushak 4.3 / 6.3 builders, BIN validation helpers, line-item aggregation | | ./config | VAT rate table, SD rate table, turnover/registration thresholds, regime constants | | ./income-tax | Personal income tax — slabs, surcharge, investment rebate (§78), advance tax (§64-65), zakat deduction, freelancer adjustments, depreciation helpers | | ./tds | TDS withholding matrix (contractor, professional, rent, interest, dividend, commission, advertisement, import) | | ./vds | VDS withholding matrix | | ./accounts | accountFor, ancillaryAccounts, createAccountMapper, BD_VAT_ACCOUNT_CODES — BFRS chart mapping with override hook |

Design

  • Pure functions on plain data. No I/O, no persistence, no events.
  • Deterministic. Same inputs → same outputs. Clocks injected explicitly.
  • Integer minor-unit arithmetic. Money stays in paisa; float math is isolated to ratio/percent calculations using decimal.js.
  • Zod schemas at the seams. Input validation is opt-in — import schemas from ./musok / ./config when wiring untrusted payloads.
  • Pluggable account mapping. The default BD_VAT_ACCOUNT_CODES matches @classytic/ledger-bd chart codes (2132 VAT payable, 1150 VAT receivable, 1157 transition, 2135 TDS, 2136 VDS). Override per-deployment via createAccountMapper({ overrides }).

Testing

npm test                    # unit + integration (566 tests, ~5 s)
npm run test:unit           # pure calculation tests
npm run test:integration    # cross-module scenarios (invoice totals, returns)
npm run typecheck
npm run lint

License

MIT — see LICENSE.