- Assertion Testing
- Async Hooks
- Buffer
- C++ Addons
- C/C++ Addons - N-API
- Child Processes
- Cluster
- Command Line Options
- Console
- Crypto
- Debugger
- Deprecated APIs
- DNS
- Domain
- ECMAScript Modules
- Errors
- Events
- File System
- Globals
- HTTP
- HTTP/2
- HTTPS
- Inspector
- Internationalization
- Modules
- Net
- OS
- Path
- Performance Hooks
- Process
- Punycode
- Query Strings
- Readline
- REPL
- Stream
- String Decoder
- Timers
- TLS/SSL
- Tracing
- TTY
- UDP/Datagram
- URL
- Utilities
- V8
- VM
- ZLIB
Node.js v9.11.2 Documentation
Table of Contents
Internationalization Support#
Node.js has many features that make it easier to write internationalized programs. Some of them are:
- Locale-sensitive or Unicode-aware functions in the ECMAScript Language Specification:
- All functionality described in the ECMAScript Internationalization API
Specification (aka ECMA-402):
Intlobject- Locale-sensitive methods like
String.prototype.localeCompare()andDate.prototype.toLocaleString()
- The WHATWG URL parser's internationalized domain names (IDNs) support
require('buffer').transcode()- More accurate REPL line editing
require('util').TextDecoder- RegExp Unicode Property Escapes
Node.js (and its underlying V8 engine) uses ICU to implement these features in native C/C++ code. However, some of them require a very large ICU data file in order to support all locales of the world. Because it is expected that most Node.js users will make use of only a small portion of ICU functionality, only a subset of the full ICU data set is provided by Node.js by default. Several options are provided for customizing and expanding the ICU data set either when building or running Node.js.
Options for building Node.js#
To control how ICU is used in Node.js, four configure options are available
during compilation. Additional details on how to compile Node.js are documented
in BUILDING.md.
--with-intl=none/--without-intl--with-intl=system-icu--with-intl=small-icu(default)--with-intl=full-icu
An overview of available Node.js and JavaScript features for each configure
option:
none |
system-icu |
small-icu |
full-icu |
|
|---|---|---|---|---|
String.prototype.normalize() |
none (function is no-op) | full | full | full |
String.prototype.to*Case() |
full | full | full | full |
Intl |
none (object does not exist) | partial/full (depends on OS) | partial (English-only) | full |
String.prototype.localeCompare() |
partial (not locale-aware) | full | full | full |
String.prototype.toLocale*Case() |
partial (not locale-aware) | full | full | full |
Number.prototype.toLocaleString() |
partial (not locale-aware) | partial/full (depends on OS) | partial (English-only) | full |