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

kanjify

v0.1.0

Published

Convert between bigints, numbers and Japanese kanji numerals

Readme

Kanjify

JS/TS utility to convert between number/bigint and Japanese kanji numerals.

⚠️ Note: Negative and non-integer numbers are not supported at the moment — they are converted to their absolute integer part.

📦 Installation

npm install kanjify

✨ Usage

import { numberToKanji, kanjiToNumber } from 'kanjify';

numberToKanji(123); // 一百二十三
numberToKanji(1234); // 一千二百三十四
numberToKanji(12345); // 一万二千三百四十五
numberToKanji(123456789); // 一億二千三百四十五万六千七百八十九

numberToKanji(9223372036854775807n);
// 九百二十二京三千三百七十二兆三百六十八億五千四百七十七万五千八百七

numberToKanji(123, { form: 'daiji' }); // 壱佰弐拾参
numberToKanji(12345, { form: 'daiji' }); // 壱萬弐仟参佰肆拾伍
numberToKanji(123456789, { form: 'daiji' }); // 壱億弐阡参佰肆拾伍萬陸阡漆佰捌拾玖

numberToKanji(123, { form: 'common-daiji' }); // 壱百弐拾参
numberToKanji(12345, { form: 'common-daiji' }); // 壱萬弐千参百四拾五
numberToKanji(123456789, { form: 'common-daiji' }); // 壱億弐千参百四拾五万六千七百八拾九

numberToKanji(0); // 零
numberToKanji(0, { zeroStyle: 'sign' }); // 〇

numberToKanji(Number.MAX_SAFE_INTEGER + 1);
// Error: The number is not a safe integer. Use bigint instead. Max safe integer is 9007199254740991

numberToKanji(Number.MAX_SAFE_INTEGER + 1, { ignoreUnsafeNumber: true });
// 九千七兆千九百九十二億五千四百七十四万九百九十二

kanjiToNumber('一百二十三'); // 123
kanjiToNumber('一万二千三百四十五'); // 12345
kanjiToNumber('一億二千三百四十五万六千七百八十九'); // 123456789

kanjiToNumber('壱佰弐拾参'); // 123
kanjiToNumber('壱萬弐仟参佰肆拾伍'); // 12345
kanjiToNumber('壱億弐仟参佰肆拾伍萬陸仟漆佰捌拾玖'); // 123456789

kanjiToNumber('壱萬弐千参百四拾五'); // 12345
kanjiToNumber('壱億弐千参百四拾五萬六千七百八拾九'); // 123456789

// Returns `number` by default
kanjiToNumber('九百二十二那由他'); // 9.22e+62

// `bigint` will be always returned
kanjiToNumber('九百二十二那由他', { returnType: 'bigint' });
// 922000000000000000000000000000000000000000000000000000000000000n

// `number` if safe integer, else `bigint`
kanjiToNumber('一万', { returnType: 'mixed' }); // 10000
kanjiToNumber('九百二十二那由他', { returnType: 'mixed' });
// 922000000000000000000000000000000000000000000000000000000000000n

kanjiToNumber('〇'); // 0
kanjiToNumber('零'); // 0