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

chinese-characters-decomposition

v0.0.1

Published

Typed JSON dataset of Chinese character decompositions (CCD), with a parser for the source TSV.

Readme

chinese-characters-decomposition

Typed JSON dataset of Chinese character decompositions (CCD), with a parser for the source TSV.

The data comes from the Wikimedia Commons CCD table (21,169 entries), which lists each character together with its stroke count, structural composition type, sub-components, Cangjie signature, and Kangxi radical.

Install

npm install chinese-characters-decomposition

The package ships an ESM entry point (index.js) with TypeScript declarations (index.d.ts), so it works in any modern Node.js, TypeScript, or bundled environment. If you only need the raw data, import chinese-characters-decomposition/ccd.json to skip the JS wrapper.

Usage

import ccd, { type CcdEntry } from "chinese-characters-decomposition";

const entry: CcdEntry | undefined = ccd.find((e) => e.component === "好");
// {
//   component: "好",
//   strokes: 6,
//   compositionType: "吅",
//   leftComponent: "女",
//   leftStrokes: 3,
//   rightComponent: "子",
//   rightStrokes: 3,
//   signature: "VND",
//   notes: "/",
//   section: "女",
// }

Or import the raw JSON directly:

import dataset from "chinese-characters-decomposition/ccd.json";

Entry shape

| Field | Type | Description | | ----------------- | ---------------- | -------------------------------------------------------------- | | component | string | The character being decomposed. | | strokes | number | Total stroke count. | | compositionType | string | Structure indicator (, , , , , …, or *). | | leftComponent | string \| null | First sub-component (null when atomic). | | leftStrokes | number | Stroke count of the first sub-component. | | rightComponent | string \| null | Second sub-component (null when atomic). | | rightStrokes | number | Stroke count of the second sub-component. | | signature | string | Cangjie-style code (may be empty). | | notes | string | Free-form source notes (/, */, ?/, …). | | section | string \| null | Kangxi radical the character is filed under. |

In the source TSV, missing/atomic sub-components and sections are encoded as *; this parser converts them to null.

Regenerating ccd.json

scripts/parse.ts rebuilds ccd.json from data/ccd.tsv. It runs automatically on npm publish via prepublishOnly.

bun run build   # regenerate ccd.json from data/ccd.tsv

License

MIT. The underlying CCD table is distributed under the terms of the Wikimedia Commons project.