package
Turn an array into a list of comma-separated values, appropriate for use in an English sentence.
npm install listifyGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 1 packages.
19.7 kB
Includes dependencies.
Turn an array into a list of comma-separated values, appropriate for use in an English sentence.
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
Simply clone the repo, npm install, and run npm test