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

@arraypress/stripe-tax-codes

v1.0.0

Published

Stripe tax code categories for e-commerce. Curated common categories with friendly labels, plus utilities for lookup and custom categories.

Downloads

37

Readme

@arraypress/stripe-tax-codes

Stripe tax code categories for e-commerce. Curated common categories with friendly labels, plus utilities for lookup and custom categories. Zero dependencies.

Works in Node.js, Cloudflare Workers, Deno, Bun, and browsers.

Installation

npm install @arraypress/stripe-tax-codes

Usage

import {
  TAX_CATEGORIES,
  getCategory,
  getStripeTaxCode,
  isTaxExempt,
  getCategories,
  getCategoriesGrouped,
} from '@arraypress/stripe-tax-codes';

// Look up a category
const cat = getCategory('digital');
// => { id: 'digital', label: 'Digital Goods', description: '...', stripeTaxCode: 'txcd_10010001', exempt: false }

// Get the Stripe tax code for checkout
const taxCode = getStripeTaxCode('clothing');
// => 'txcd_20010001'

// Check if something is tax exempt
isTaxExempt('gift_card'); // true
isTaxExempt('electronics'); // false

// Get all taxable categories
const taxable = getCategories({ exempt: false });

// Get categories grouped for a UI dropdown
const groups = getCategoriesGrouped();
// groups.digital   => [{ id: 'digital', ... }, { id: 'saas', ... }, ...]
// groups.physical  => [{ id: 'clothing', ... }, { id: 'electronics', ... }, ...]
// groups.services  => [{ id: 'consulting', ... }, { id: 'education', ... }]
// groups.other     => [{ id: 'general', ... }, { id: 'exempt', ... }, ...]

With Stripe Checkout

import Stripe from 'stripe';
import { getStripeTaxCode } from '@arraypress/stripe-tax-codes';

const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);

const session = await stripe.checkout.sessions.create({
  line_items: [{
    price_data: {
      currency: 'usd',
      product: 'prod_xxx',
      unit_amount: 2999,
      tax_behavior: 'exclusive',
    },
    quantity: 1,
    tax_rates: [],
    // Use the Stripe tax code from the category
    dynamic_tax_rates: [],
  }],
  // Or set tax code on the Stripe Product
  // product.tax_code = getStripeTaxCode('clothing')
});

Categories

| ID | Label | Stripe Tax Code | Exempt | |----|-------|-----------------|--------| | general | General | txcd_99999999 | No | | exempt | Tax Exempt | txcd_00000000 | Yes | | digital | Digital Goods | txcd_10010001 | No | | saas | SaaS / Cloud Services | txcd_10103001 | No | | digital_audio | Digital Audio | txcd_10201000 | No | | digital_video | Digital Video | txcd_10202000 | No | | digital_books | Digital Books | txcd_10301000 | No | | digital_games | Digital Games | txcd_10401000 | No | | digital_images | Digital Images | txcd_10501000 | No | | physical | Physical Goods | txcd_99999999 | No | | clothing | Clothing & Apparel | txcd_20010001 | No | | food_grocery | Groceries | txcd_40030000 | No | | food_prepared | Prepared Food | txcd_40060003 | No | | food_supplements | Dietary Supplements | txcd_40050001 | No | | electronics | Electronics | txcd_34021000 | No | | furniture | Furniture | txcd_20060000 | No | | health_beauty | Health & Beauty | txcd_40050000 | No | | books_physical | Physical Books | txcd_35010000 | No | | toys | Toys & Games | txcd_20080000 | No | | jewelry | Jewelry & Watches | txcd_20070000 | No | | sports | Sports & Outdoors | txcd_20090000 | No | | pet_supplies | Pet Supplies | txcd_20100000 | No | | education | Educational Materials | txcd_10502001 | No | | gift_card | Gift Cards | txcd_10502000 | Yes | | consulting | Consulting Services | txcd_19003001 | No | | infrastructure | Infrastructure as a Service | txcd_10101000 | No |

API Reference

TAX_CATEGORIES

Array of all built-in tax categories. Each entry has id, label, description, stripeTaxCode, and exempt fields.

getCategory(categoryId)

Get a tax category by its ID. Returns the TaxCategory object or undefined.

getStripeTaxCode(categoryId)

Get the Stripe tax code string (e.g. txcd_20010001) for a category ID. Returns undefined if not found.

isTaxExempt(categoryId)

Check if a category is tax exempt. Returns false for unknown category IDs.

getCategories(filter?)

Get all categories, optionally filtered. Pass { exempt: true } for exempt-only or { exempt: false } for taxable-only.

getCategoriesGrouped()

Get categories grouped into digital, physical, services, and other arrays. Useful for building grouped dropdown menus.

License

MIT