Registry / internationalization / ilib-localedata

ilib-localedata

JSON →
library1.5.4jsnpmunverified

The ilib-localedata package (v1.5.4) provides a LocaleData class for loading and caching iLib locale data in Node.js applications. It works with ilib-loader to fetch data from various sources (files, webpack lazy-load modules). The library supports Node.js versions 12 through 22. Key differentiators: decouples data loading from the iLib library itself, allowing custom loaders and caching strategies. Stable release cadence with regular updates.

npm install ilib-localedata
INSTALL
IMPORT
SIG · ILIB-LOCALEDATA
I
ilib-localedata
internationalizationjavascriptv1.5.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

LocaleData
import { LocaleData } from 'ilib-localedata'
const LocaleData = require('ilib-localedata')
ESM-only since v1, does not support CommonJS require.
LocaleData
import LocaleData from 'ilib-localedata'
import { LocaleData as LD } from 'ilib-localedata'
Default export also available; named export preferred for clarity.
default
import LocaleData from 'ilib-localedata'
const LocaleData = require('ilib-localedata')
Default export is the class itself. Also available as named export.

Creates a LocaleData instance and loads locale info for English (US).

import { LocaleData } from 'ilib-localedata'; const ld = new LocaleData(); const data = await ld.get('ilib-locale-info', 'en-US', 'localeinfo.json'); console.log(data);
Debug
Known issues
breakingv1.x drops support for Node.js <12.
fix
Upgrade to Node.js 12 or later.
affects: >=1.0.0 <2.0.0
breakingv1.x is ESM-only; no CommonJS support.
fix
Use ESM imports (import) instead of require().
affects: >=1.0.0
breakingThe `get` method now returns a Promise instead of using callbacks.
fix
Use async/await or .then() to handle the promise.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'ilib-loader'
ilib-loader is a required peer dependency not installed.
fix
Install ilib-loader: npm install ilib-loader
TypeError: ld.get is not a function
Using CommonJS require() which returns a default export instead of the class.
fix
Use import { LocaleData } from 'ilib-localedata' or const LocaleData = (await import('ilib-localedata')).LocaleData
Upgrade
Version history
1.5.4latest on npm
Audit
Dependencies
ilib-loaderrequiredThe LocaleData class uses ilib-loader to load locale data files.
Agent activity
4 hits · last 30 days
node
4
Resources
ilib-localedata — npm install ilib-localedata · libregistry