Internationalization Support in Node.js with ICU

Node.js provides extensive features for writing internationalized applications. These include locale-sensitive functions in ECMAScript, the Intl object, Unicode-aware string methods, internationalized domain name (IDN) support in the WHATWG URL parser, and utilities like TextDecoder, buffer.transcode(), and RegExp Unicode property escapes. These capabilities are powered by the V8 engine and the ICU (International Components for Unicode) library. Depending on how Node.js is built, ICU data can be embedded fully, partially, or disabled entirely.

ICU / Intl / ECMA-402String.prototype.normalize / localeCompare / toLocaleStringsmall-icu / system-icu / full-icuNODE_ICU_DATA / --icu-data-dirTextDecoder / RegExp Unicode Property Escapes

~2 min read · Updated Dec 29, 2025

1. Internationalization Features in Node.js


  • Unicode-aware functions like String.prototype.normalize(), toLowerCase(), and toUpperCase().
  • The Intl object and locale-sensitive methods such as localeCompare() and Date.prototype.toLocaleString().
  • IDN support in the WHATWG URL parser.
  • Utilities like buffer.transcode() and util.TextDecoder.
  • Support for RegExp Unicode Property Escapes.

2. Build Options for ICU


Four main options control ICU usage when compiling Node.js:


  • none: Disables ICU; most internationalization features are unavailable.
  • system-icu: Links against ICU installed on the system. Support depends on available locale data.
  • small-icu: Embeds limited ICU data (usually English-only) in the binary.
  • full-icu: Embeds the full ICU dataset. Default in official Node.js binaries.

3. Feature Comparison


Featurenonesystem-icusmall-icufull-icu
normalize()disabledfullfullfull
Intldisabledpartial/fullpartial (English-only)full
localeCompare()not locale-awarefullfullfull
Date.toLocaleString()not locale-awarepartial/fullpartial (English-only)full
TextDecoderbasicpartial/fullUnicode-onlyfull
RegExp Unicodedisabledfullfullfull

4. Providing ICU Data at Runtime


With small-icu, additional ICU data can be loaded at runtime:


  • Using the --icu-data-dir CLI option.
  • Setting the NODE_ICU_DATA environment variable.
  • Configuring --with-icu-default-data-dir at build time.

The full-icu npm module simplifies installation by downloading the correct ICU dataset for the running Node.js version.


5. Detecting ICU Support


  • typeof Intl === 'object': Checks if Intl is available.
  • typeof process.versions.icu === 'string': Confirms ICU is enabled.
  • Testing Intl.DateTimeFormat with non-English locales verifies full ICU support.

6. Example


const january = new Date(9e8);
const spanish = new Intl.DateTimeFormat('es', { month: 'long' });
console.log(spanish.format(january)); // "enero" with full-icu

Conclusion


Internationalization support in Node.js, powered by ICU, enables developers to build multilingual and locale-sensitive applications. Depending on project needs, developers can choose between none, system-icu, small-icu, or full-icu. Full-icu provides the richest feature set, while small-icu balances binary size with basic functionality.


Written & researched by Dr. Shahin Siami

Related Articles

Comprehensive Guide to the Node.js VM Module (node:vm)

The node:vm module allows you to compile and execute JavaScript code inside isolated V8 contexts — essentially creating lightweight sandboxes within your Node.js application. These contexts have their own global scope and can run code independently from the main environment. However, vm is NOT a security sandbox. It is powerful for dynamic code execution, template engines, REPLs, plugin systems, and controlled module execution, but it must never be used to run untrusted code.

Continue

Comprehensive Guide to the V8 Module in Node.js (node:v8)

The node:v8 module exposes low-level APIs that interact directly with the V8 JavaScript engine embedded in Node.js. . These APIs provide access to heap statistics, heap snapshots, coverage tools, serialization mechanisms, V8 flags, object queries, and promise lifecycle hooks. The module is essential for performance analysis, memory debugging, tooling, and advanced Node.js internals work.

Continue

Comprehensive Guide to Node.js Worker Threads (node:worker_threads)

The node:worker_threads module enables true multithreading in Node.js by running JavaScript in separate threads. While Node.js is traditionally single‑threaded, worker threads allow CPU‑intensive tasks to run in parallel without blocking the event loop. They support shared memory, zero‑copy transfers, worker pools, resource limits, and advanced synchronization APIs. Worker threads are ideal for heavy computation, data processing, and parallel workloads—while async I/O remains best handled by the main thread.

Continue

Comprehensive Guide to the Node.js util Module (node:util)

The node:util module provides a powerful collection of helper functions used throughout Node.js core and extremely useful for application developers. These utilities support debugging, inspection, formatting, type checking, callback/Promise conversions, argument parsing, text encoding, MIME handling, and more. It is one of the most versatile and essential toolkits in the Node.js ecosystem.

Continue

Comprehensive Guide to the URL Module in Node.js

The node:url module provides tools for parsing, constructing, and manipulating URLs. Node.js supports two URL APIs: WHATWG URL API — modern, browser‑compatible, standards‑based. Legacy Node.js URL API — older, Node‑specific, now discouraged. The WHATWG API is the recommended approach for all modern applications. It provides a clean, consistent interface for working with URL components, query parameters, and structured URL patterns.

Continue

راهنمای جامع UDP / Datagram Sockets در Node.js

ماژول node:dgram پیاده‌سازی کامل سوکت‌های UDP را در Node.js فراهم می‌کند. UDP یک پروتکل سبک، بدون اتصال (connectionless) و مناسب برای برنامه‌های بلادرنگ مانند VoIP، بازی‌ها، IoT، سیستم‌های پخش (broadcast) و چندپخشی (multicast) است. این ماژول امکان ساخت سوکت، ارسال و دریافت دیتاگرام، مدیریت TTL، عضویت در گروه‌های multicast، کنترل بافرها، و مدیریت رفتار سطح پایین شبکه را فراهم می‌کند.

Continue