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

@revam/chinese-numeral-conversion

v1.0.1

Published

A package for numeral conversion.

Readme

@revam/chinese-numeral-conversion

npm version

A package for converting numerals between chinese words and numbers, with support for different numeral label sets (such as Traditional Chinese and Simplified Chinese, and/or a custom label set).

Installation

To install this package, you can use either npm or yarn (or your other favorite package manager):

  • For npm, run the following command:

    npm install @revam/chinese-numeral-conversion
  • For yarn, run the following command:

    yarn add @revam/chinese-numeral-conversion

Usage

Some examples of how to use the package and its exported methods:

Converting from words:

import { fromWords } from "@revam/chinese-numeral-conversion";

// Stringified digits.
let number = fromWords("13370");
console.log(number); // Output: 13370

number = fromWords("第13370");
console.log(number); // Output: 13370

// Traditional Chinese with units.
number = fromWords("一萬三千三百七十");
console.log(number); // Output: 13370

number = fromWords("第一萬三千三百七十");
console.log(number); // Output: 13370

// Simplified Chinese with units.
number = fromWords("一万三千三百七十");
console.log(number); // Output: 13370

number = fromWords("第一万三千三百七十");
console.log(number); // Output: 13370

// Just numerals.
number = fromWords("一三三七零");
console.log(number); // Output: 13370

number = fromWords("第一三三七零");
console.log(number); // Output: 13370

number = fromWords("一三三七〇");
console.log(number); // Output: 13370

number = fromWords("第一三三七〇");
console.log(number); // Output: 13370

Converting to words:

import { SimplifiedChineseLabelSet, toOrdinal, toWords, toWordsOrdinal } from "@revam/chinese-numeral-conversion";

// Standard numberal digits.
const numeral = (13370).toString(10);
console.log(numeral); // Output: "13370"

// Convert a number to its word form in Traditional Chinese.
const traditionalWords = toWords(13370);
console.log(traditionalWords); // Output: "一萬三千三百七十"

// Convert a number to its word form Simplified Chinese.
const simplifiedWords = toWords(13370, SimplifiedChineseLabelSet);
console.log(simplifiedWords); // Output: "一万三千三百七十"



// Convert a number to its ordinal form using pure digits.
const ordinalNumeral = toOrdinal(13370);
console.log(ordinalNumeral); // Output: "第13370"

// Convert a number to its ordinal word form in Traditional Chinese.
const ordinalTraditionalWords = toWordsOrdinal(13370);
console.log(ordinalTraditionalWords); // Output: "第一萬三千三百七十"

// Convert a number to its ordinal word form in Simplified Chinese.
const ordinalSimplifiedWords = toWordsOrdinal(13370, SimplifiedChineseLabelSet);
console.log(ordinalSimplifiedWords); // Output: "第一万三千三百七十"

Checking if a string is using traditional big units or simplified big units:

import { isSimplifiedChinese, isTraditionalChinese } from "@revam/chinese-numeral-conversion";

const traditionalWords = "一萬三千三百七十";
const simplifiedWords = "一万三千三百七十";

// Check if a stringified number is written as Traditional Chinese
let isTraditional = isTraditionalChinese(traditionalWords);
console.log(isTraditional); // Output: true

isTraditional = isTraditionalChinese(simplifiedWords);
console.log(isTraditional); // Output: false

// Check if a stringified number is written as Simplified Chinese
let isSimple = isSimplifiedChinese(traditionalWords);
console.log(isSimple); // Output: false

isSimple = isSimplifiedChinese(simplifiedWords);
console.log(isSimple); // Output: true

TypeScript

This package includes TypeScript declarations for the package, providing type checking, autocompletion, and documentation for the exported functions and class. The package supports both ES Modules (mjs) and CommonJS (cjs) module systems.

Contributing

We gladly welcome contributions and corrections to improve the package. If you'd like to contribute, feel free to submit a pull request, create an issue, or reach out with your suggestions on the GitHub repository. You can also check the Issues and PR tabs for ongoing discussions and/or contributions.

Your input and support are greatly appreciated!

License

This package is available under the ISC license. See the license.txt file for more details.