Intl.ListFormat

A spec-compliant polyfill for Intl.ListFormat fully tested by the official ECMAScript Conformance test suite

npm Version size

Installation

npm install @formatjs/intl-listformat

Requirements

If you're supporting IE11-, this requires Intl.getCanonicalLocales.

Usage

To use the polyfill, just import it to make sure that a fully functional Intl.ListFormat is available in your environment:

import '@formatjs/intl-listformat/polyfill';

If Intl.ListFormat already exists, the polyfill will not be loaded.

To load locale data, you can include them on demand:

import '@formatjs/intl-listformat/polyfill';
import '@formatjs/intl-listformat/locale-data/en'; // Add locale data for en
import '@formatjs/intl-listformat/locale-data/de'; // Add locale data for de

If you want to polyfill all locales (e.g for Node):

import '@formatjs/intl-listformat/polyfill-locales';

Tests

This library is fully test262-compliant.