Skip to content

Releases: forzagreen/n2words

v4.0.0

05 Mar 21:08
427b607

Choose a tag to compare

4.0.0 (2026-03-05)

⚠ BREAKING CHANGES

  • rename all generic language codes to BCP 47 locale-specific codes (#242)
  • es: split Spanish into locale-specific variants (#241)
  • remove index.js barrel, use subpath exports only (#235)
  • rename toWords to toCardinal, form-agnostic architecture (#234)
  • lang: split English into en-GB and en-US with extended scales and options (#232)
  • ESM-first browser bundles (#225)

Features

  • add 14 English locale variants (#255) (1b87dd9)
  • add toOrdinal and toCurrency to 44 languages (#256) (35bdc9b)
  • de-DE: add toOrdinal and toCurrency functions (#245) (59d13fb)
  • en-GB: add toOrdinal and toCurrency functions (#243) (c651780)
  • en-US: add toCurrency function for currency words (#237) (44243b7)
  • en-US: add toOrdinal function for ordinal number words (#233) (4db67bf)
  • ESM-first browser bundles (#225) (e97d895)
  • es: split Spanish into locale-specific variants (#241) (d301733)
  • fr-FR: add toOrdinal and toCurrency functions (#246) (b95e513)
  • it-IT: add toOrdinal and toCurrency functions (#247) (93ea3eb)
  • lang: split English into en-GB and en-US with extended scales and options (#232) (8e4a0df)
  • nl-NL: add toOrdinal and toCurrency functions (#249) (abcac65)
  • pt-PT: add toOrdinal and toCurrency functions (#248) (0d7d972)
  • ru-RU: add toOrdinal and toCurrency functions (#244) (86ad7a3)

Bug Fixes

  • core: pre-v4 audit fixes for parsers and exports (#262) (33d257b)
  • core: pre-v4 audit fixes for parsers and exports (#264) (0268988)
  • deps-dev: update dependencies to resolve tar vulnerability (#230) (1f86240)
  • es-MX,fa-IR: correct number scale implementations (#250) (ab05310)

Code Refactoring

  • remove index.js barrel, use subpath exports only (#235) (782768b)
  • rename all generic language codes to BCP 47 locale-specific codes (#242) (8a8328d)
  • rename toWords to toCardinal, form-agnostic architecture (#234) (1648e1a)

v3.1.0

08 Jan 20:15
ad0d738

Choose a tag to compare

3.1.0 (2026-01-08)

Features

Bug Fixes

  • lang: remove precomputed lookup tables from all languages (#224) (fbe0c7b)

v3.0.0 - Functional Architecture

07 Jan 07:13
v3.0.0
fbd5c01

Choose a tag to compare

Complete rewrite from class-based to functional architecture with major performance improvements.

⚠ BREAKING CHANGES

Migration required - API has changed:

From v1.x (default export)

Note: v1 bundled all languages into a single wrapper function with runtime language selection via { lang: 'es' }. v3 requires explicit language imports for tree-shaking—only the languages you import are included in your bundle.

Context v1 v3
Import (all) import n2words from 'n2words' import { en, es } from 'n2words'
Import (single) import es from 'n2words/languages/es' import { toWords } from 'n2words/es'
Usage n2words(42, { lang: 'es' }) es(42) or toWords(42)
Browser n2words(42, { lang: 'es' }) n2words.es(42)
CDN (single) .../dist/languages/es.js .../dist/languages/es.js (unchanged)

From v2.x (class-based)

Context v2 v3
Import (all) import { EnglishConverter } from 'n2words' import { en } from 'n2words'
Import (single) import { EnglishConverter } from 'n2words/en' import { toWords } from 'n2words/en'
Usage EnglishConverter(42) en(42) or toWords(42)
Browser n2words.EnglishConverter(42) n2words.en(42)
CDN (single) .../dist/EnglishConverter.js .../dist/languages/en.js

Highlights

  • 3x-85x faster conversion across languages
  • 70-96% less memory per conversion
  • 75-92% smaller per-language bundles
  • 52 languages - all self-contained, tree-shakeable modules

New Languages

am (Amharic), am-Latn (Amharic Latin), fi (Finnish), ha (Hausa), hbo (Biblical Hebrew), sr-Cyrl (Serbian Cyrillic), zh-Hant (Traditional Chinese)

Performance Improvements

  • Precomputed lookup tables (en, pt, he, hbo)
  • BigInt modulo instead of string slicing (ja, sw)
  • Eliminated class instantiation overhead

See #206 for full details.

v2.0.0

03 Jan 03:00
v2.0.0
d51a190

Choose a tag to compare

v2.0.0 Pre-release
Pre-release

What's Changed

New Contributors

Full Changelog: v1.24.0...v2.0.0

v1.24.0

25 Dec 00:29
73a4d16

Choose a tag to compare

What's Changed

Full Changelog: v1.23.1...v1.24.0

v1.23.1

25 Oct 23:34
6297a52

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.23.0...v1.23.1

v1.23.0

30 Aug 18:06
60b9d22

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.22.0...v1.23.0

v1.22.0

06 Aug 09:12
751b4e7

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.21.0...v1.22.0

v1.21.0

15 Jun 17:32

Choose a tag to compare

What's Changed

Full Changelog: v1.20.0...v1.21.0

v1.20.0

14 Apr 15:56
0e606b7

Choose a tag to compare

What's Changed

Full Changelog: v1.19.1...v1.20.0