full-icuInstall full ICU (Internationalization) data from GitHub or npm for Node.js.
What is this and why would I use it?Importing this package does not have any useful effect, see below.
Originally, Node.js did not come with information for all of the world’s languages. The default build mode was “small-icu” which means English-only, saving about 50% of the total Node.js download footprint.
Since Node.js 13, full ICU data has been the default for Node.js. So this module is only helpful for older Node.js versions, or custom builds which specify small-icu.
This module does not add any internationalization capabilities to Node.js, but it can provide a convenient way of loading the data.
Please see “providing ICU data at runtime” in the Node.js docs for more information.
Am I using Let's find out:
$ node -p 'process.config.variables.icu_small' true
If you see
falsehere, you aren't using small ICU and this package won’t do anything useful for you, although it is harmless.
To useFirst, you must have a Node.js that is configured for
small-icu. See above.
npm install full-icu
Note: Set env var
FULL_ICU_PREFER_NPM=trueto prefer using the
icu4c-datanpm module, otherwise the default is now to load from ICU4C’s GitHub release.
To install globally
npm install -g full-icu
After InstallationInstructions will be printed out on how to activate this data for your version of node.
This work gets done in a
postinstallscript which copies the
icudt*.datfile up to this module's level.
APINote that this is only packaging and build metadata. For Internationalization API, see Intl.
require('full-icu')returns a few properties:
nodever- the full Node version (ex:
node_maj- the major part of the node version (ex:
node_min- the minor part of the node version (ex
icu_small- if truthy, means that node was built with
full-icupackage is not relevant.
icuver- the full ICU version, if available, such as 55.1. Sometimes only the major version is available.
icumaj- ICU major ver, such as
55. May be ===
icumin- ICU minor version, such as
icuend- ICU endianness - little, big or ebcdic.
npmpackage needed to get full ICU data, if any.
icudat- the raw data file ICU expects to find for full data, if any.
noi18n- if truthy, no ICU / Intl build was enabled for your node version. Sorry.
oldNode- The node version is older than this package can really think about.
node-full-icu-pathwill print the full
icudt*.datpath, if available.
CONTRIBUTINGPlease see our
CONTRIBUTINGguide if you'd like to help with this initiative!
COPYRIGHTCopyright © 1991-2021 Unicode, Inc. and Node.js contributors. All rights reserved.