Skip to content

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

License

Notifications You must be signed in to change notification settings

sebacruz/andlist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published