davidohlin / grammarray

Prettier arrays.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

grammarray Build Status

Array to a better string.

Install

$ npm install --save grammarray

Usage

const grammarray = require('grammarray');
const arr = ['Marvin Gaye', 'Led Zeppelin', 'Bigge'];

grammarray(arr);
//=> 'Marvin Gaye, Led Zeppelin and Biggie'

grammarray(arr, {
	before: '~~ ',
	delimiter: ' and ',
	lastDelimiter: 'but also',
	after: ' ~~'
});
//=> '~~ Marvin Gaye and Led Zeppelin but also Biggie ~~'

License

MIT © David Öhlin

About

Prettier arrays.

License:MIT License


Languages

Language:JavaScript 100.0%