yhabib / join-me

Utility to join list of words with a separator and the last one with keyword

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

joinMe CI

Utility to join list of words with a separator and the last one with keyword.

Install

$ npm install join-me

Use

const joinMe = require('join-me');

const list = ['hello', 'hallo', 'ciao', 'hola'];
let readableList = joinMe({ list }) // hello, hallo, ciao and hola

// pass extra arguments
readableList = joinMe({ list, keyword: ' und ' }) // hello, hallo, ciao und hola
readableList = joinMe({ list, separator: '|', keyword: '-' }) // hello|hallo|ciao-hola

License

MIT © Yusef Habib

About

Utility to join list of words with a separator and the last one with keyword

License:MIT License


Languages

Language:JavaScript 100.0%