npm.io
1.2.0 • Published 4 years ago

andlist

Licence
MIT
Version
1.2.0
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
1

andlist

Turns an array of strings into a friendly delimited string separated by commas and an "and".

Install

$ npm install andlist

Example

const andlist = require('andlist');
const arr = ['one', 'two', 'three', 'four'];

console.log(andlist(arr, ', ', ' and '));
$ node example/basic.js
one, two, three and four

Keywords