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

china-iit-engine

v1.0.0

Published

Zero-dependency China Individual Income Tax (IIT) engine for expats and residents: 7-bracket progressive tax, annual bonus separate taxation, 6-city social security caps, BIA allowances, 12-month cumulative withholding, and GBA 15% subsidy.

Readme

china-iit-engine

Zero-dependency TypeScript engine for China Individual Income Tax (IIT) modeling (2026–2027), supporting resident & expatriate payroll calculations, annual one-off bonus separate taxation (extended through Dec 31, 2027), 6-city statutory social security caps, Benefits-in-Kind (BIA) tax savings, 12-month cumulative withholding schedules, and the Greater Bay Area (GBA) 15% IIT subsidy.

Installation

npm install china-iit-engine

Usage

import { calculateExpatIIT, calculateGBASubsidy } from 'china-iit-engine';

const result = calculateExpatIIT({
  incomePeriod: 'monthly',
  grossAmount: 45000,
  currency: 'RMB',
  cityId: 'shanghai',
  socialSecurityMode: 'exempt',
  biaItems: {
    housingRental: 12000,
    childrenEducation: 0,
    languageTraining: 0,
    homeLeaveFlights: 0,
    mealAllowance: 2000,
    laundryCost: 0,
    relocationMoving: 0,
    businessTravelPerDiem: 0,
  },
  annualBonus: 90000,
});

console.log({
  annualNetPayRMB: result.totalAnnualNetPayRMB,
  annualIITRMB: result.totalAnnualIITRMB,
  biaTaxSavingsRMB: result.taxSavingsFromBIARMB,
  effectiveRate: result.effectiveTaxRate,
});

const gba = calculateGBASubsidy(result.totalAnnualIITRMB, result.annualTaxableIncomeRMB);
console.log(gba);

Included Modules & Data

  • CHINA_IIT_BRACKETS: 7-tier progressive annual comprehensive IIT brackets (3% to 45%) with quick deductions.
  • CITIES_CONFIG: Statutory social security base floors, 3x caps, and employee/employer contribution rates for Shanghai, Beijing, Shenzhen, Guangzhou, Hangzhou, and Chengdu.
  • GBA_CITIES: 9 Greater Bay Area municipalities offering the 15% IIT ceiling subsidy (up to RMB 5,000,000/year).
  • RELOCATION_MODELS: Cross-border effective tax & cost-of-living comparison models for US (CA/NY/TX), UK (London), Germany, Singapore, and Hong Kong SAR.
  • calculateCumulativeMonthlyWithholding: Month-by-month cumulative withholding breakdown with tax bracket jump detection.
  • calculateLandlordFapiaoAnalysis: Break-even ROI analysis for rental invoice (fapiao) tax surcharges vs BIA tax savings.

License

MIT — Maintained by Abigail Davis ([email protected]) for ChinaTaxCalc.com.