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

word-number-word

v1.1.1

Published

A TypeScript/JavaScript utility for converting numbers to words and vice versa — including support for decimals, negatives, and currency converting.

Downloads

59

Readme

Word-Number-Word 🔢 ↔️ 🔠

npm version License: MIT Types Build

Convert numbers to words and words back to numbers — now with support for currency. Simple, accurate, and type-safe. Works seamlessly with JavaScript, TypeScript, Node.js, React, Next.js, and even from the CLI.


✨ Features

  • 🔁 Bi-directional conversion
    • 42 → "forty-two"
    • "seven point five"7.5
  • ✅ Supports integers, negatives, and decimal numbers
  • 💰 Currency support (e.g., 10.25 ↔️ "ten dollars and twenty-five cents")
  • 🌍 Handles numbers up to trillions
  • 💻 Works with Node.js, browser environments, and CLI
  • 📦 Built with TypeScript & supports ESM and CommonJS
  • 🔧 Lightweight and dependency-free

📦 Installation

npm install word-number-word
# or
yarn add word-number-word

🚀 Usage

JavaScript / TypeScript

import {
  numberToWord,
  wordToNumber,
  currencyToWord,
  wordToCurrency,
} from "word-number-word";

// Basic usage
console.log(numberToWord(42)); // "forty-two"
console.log(wordToNumber("minus three")); // -3

// Currency support
console.log(currencyToWord(10.25, "usd")); // "ten dollars and twenty-five cents"
console.log(wordToCurrency("ten dollars and five cents", "usd")); // 10.05

CLI Usage

npx word-number-word 123
# Output: "one hundred twenty-three"

npx word-number-word "two thousand and five"
# Output: 2005

📚 API Reference

| Function | Description | Example | | --------------------------------------- | ---------------------------------------------------------- | --------------------------------------------------------------- | | numberToWord(num: number) | Converts a number to its word form | numberToWord(123)"one hundred twenty-three" | | wordToNumber(str: string) | Converts a word string into a number | wordToNumber("five")5 | | currencyToWord(num: number, currency) | Converts currency number to words (with major/minor units) | currencyToWord(4.5, "usd")"four dollars and fifty cents" | | wordToCurrency(str, currency) | Converts word form currency to number | wordToCurrency("ten dollars and five cents", "usd")10.05 |

Note: Currency codes supported "usd", "bdt", "eur", "gbp". Handles both "forty-two" and "forty two" formats.


🌐 Supported Environments

  • ✅ Node.js (v14+)
  • ✅ Modern Browsers
  • ✅ TypeScript & JavaScript
  • ✅ Frameworks: React, Next.js, Express, Vite, etc.
  • ✅ CLI (via npx or install globally)

🧪 Examples

| Input | Output | | ----------------------------------------------------- | -------------------------------- | | 123 | "one hundred twenty-three" | | -99.5 | "minus ninety-nine point five" | | "fourteen" | 14 | | "minus two" | -2 | | "three point one four" | 3.14 | | currencyToWord(4.5, "usd") | "four dollars and fifty cents" | | wordToCurrency("ten dollars and five cents", "usd") | 10.05 |


🛠️ CLI Installation (Optional)

Install globally for quick conversions in your terminal:

npm install -g word-number-word

Then use it anywhere:

word-number-word 456
# → "four hundred fifty-six"

📄 License

MIT License © Hridoy Saha


🙌 Contributing

Contributions, suggestions, and improvements are welcome!
Feel free to open an issue or submit a pull request.


📫 Contact

For support or feedback, reach out via GitHub or LinkedIn.