JSPM

  • Created
  • Published
  • Downloads 1432354
  • Score
    100M100P100Q212018F
  • License MIT

Formats JS list in a i18n-safe way

Package Exports

  • @formatjs/intl-listformat
  • @formatjs/intl-listformat/polyfill

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@formatjs/intl-listformat) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Intl ListFormat

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

npm Version size

Installation

npm install @formatjs/intl-listformat

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 use this as a ponyfill:

import IntlListFormat from '@formatjs/intl-listformat'

By default, this library comes with en data. To load additional locale, you can include them on demand:

import '@formatjs/intl-listformat/polyfill';
import '@formatjs/intl-listformat/dist/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.