JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 154776
  • Score
    100M100P100Q165221F
  • License MIT

Turn an array into a list of comma-separated values, appropriate for use in an English sentence.

Package Exports

  • listify

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 (listify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

#listify Version Badge

Build Status dependency status dev dependency status

Turn an array into a list of comma-separated values, appropriate for use in an English sentence.

Example

var listify = require('listify');

assert(listify([1, 2]) === '1 and 2');
assert(listify([1, 2, 3]) === '1, 2, and 3');
assert(listify([1, 2, 3, 4]) === '1, 2, 3, and 4');
assert(listify([1, 2, 3], { separator: '… ' }) === '1… 2… and 3');
assert(listify([1, 2, 3], { finalWord: false }) === '1, 2, 3');
assert(listify([1, 2, 3], { separator: '… ', finalWord: 'or' }) === '1… 2… or 3');

Tests

Simply clone the repo, npm install, and run npm test