To verify that ICU is enabled at all (system-icu, small-icu, or full-icu), simply checking the existence of Intl should suffice:

    1. const hasICU = typeof Intl === 'object';

    Alternatively, checking for process.versions.icu, a property defined only when ICU is enabled, works too:

    1. const hasICU = typeof process.versions.icu === 'string';

    To check for support for a non-English locale (i.e. full-icu or system-icu), [Intl.DateTimeFormat][] can be a good distinguishing factor:

    1. const hasFullICU = (() => {
    2. try {
    3. const january = new Date(9e8);
    4. const spanish = new Intl.DateTimeFormat('es', { month: 'long' });
    5. return spanish.format(january) === 'enero';
    6. } catch (err) {
    7. return false;
    8. }
    9. })();

    For more verbose tests for Intl support, the following resources may be found to be helpful:

    • [btest402][]: Generally used to check whether Node.js with Intl support is built correctly.
    • [Test262][]: ECMAScript’s official conformance test suite includes a section dedicated to ECMA-402.