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

digit-words

v0.11.6

Published

Digits to words converted. Language support: English, Polish, Czech.

Readme

Digit Words

Simple and small library for converting digits to words. Contributors all welcome!

| Language | Code | Supported | | -------- | ---- | --------- | | Polish | pl | Yes | | English | en | Yes | | Czech | cz | Yes | | German | de | Yes | | French | fr | Yes | | Spanish | es | Yes | | Croatian | hr | Yes | | Hindi | hi | Yes |

Installation

Using npm:

npm i digit-words

CLI Usage

The package includes a command-line interface for quick conversions:

# Basic usage (defaults to Polish)
npx digit-words 1234

# Specify language
npx digit-words --lang en 1234.56
npx digit-words -l pl 2112,24

# Get help
npx digit-words --help

CLI Options:

  • --lang, -l <language>: Language for conversion (default: pl)
  • --help, -h: Show help information

Supported languages: en, de, es, hr, hi, pl, cz, fr

Library Usage

The library provides a single async function toText that converts numbers to their word representation in various languages.

Basic Usage

import { toText } from 'digit-words';

// Using default language (Polish)
const result = await toText(1234);
// Returns: 'jeden tysiąc dwieście trzydzieści cztery'

// Using English
const englishResult = await toText(1234, 'en');
// Returns: 'one thousand two hundred thirty-four'

// Using string input
const stringResult = await toText('42', 'en');
// Returns: 'forty-two'

API Reference

toText(value: number | string, lang?: Language): Promise<ConverterResult>

Converts a number to its word representation in the specified language.

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | value | number \| string | Yes | - | The number to convert. Can be a number or string that can be parsed to a number. | | lang | Language | No | 'pl' | The language code for the output. See supported languages above. |

Returns: Promise<ConverterResult> - A promise that resolves to the word representation of the number.

Throws:

  • Error if the input value is not a valid number
  • Error if the input value is negative
  • Error if the specified language is not supported

Type Definitions

type Language = 'pl' | 'en' | 'cz' | 'de' | 'fr' | 'es' | 'hr' | 'hi';
type ConverterResult = string;

License

MIT