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

@leonsilicon/mozillazg-pinyin-data

v0.0.1

Published

Mapping of Chinese characters to pinyin (with tone numbers) derived from mozillazg/pinyin-data, distributed as JSON.

Readme

@leonsilicon/mozillazg-pinyin-data

Mapping of Chinese characters to pinyin readings, with tone numbers (e.g. yi1) instead of diacritics. The data is derived from mozillazg/pinyin-data and converted at build time using pinyin-tone2.

Install

npm install @leonsilicon/mozillazg-pinyin-data

Usage

The package exposes a single subpath, /pinyin. Internally it re-exports pinyin.json using an import attribute, so consumers can use a plain default import:

import pinyin from "@leonsilicon/mozillazg-pinyin-data/pinyin";

pinyin["一"]; // ["yi1", "yi2", "yi4"]
pinyin["略"]; // ["lve4"]
pinyin["〇"]; // ["ling2", "yuan2", "xing1"]

TypeScript:

import pinyin from "@leonsilicon/mozillazg-pinyin-data/pinyin";
// pinyin is typed as Record<string, string[]>

Tone numbers

  • Tones 1–4 are appended as a single digit (aa1, a2, a3, a4).
  • The neutral tone is written as 5 (e.g. ma5).
  • ü is written as v (e.g. lüèlve4).
  • ê (used in a handful of interjections like 欸) is written as e^ (e.g. ếe^2).
  • Syllabic-consonant interjections (ḿ ǹ ňg … from characters like 呒, 嗯) are written with the tone digit directly on the base letter (m2, n4, ng3, …).

Rebuild the data

The JSON file is regenerated from data/pinyin.txt:

bun run build

This writes pinyin.json at the repository root.

License

MIT. The underlying character→pinyin mapping is from mozillazg/pinyin-data (MIT).