npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

join-component

1.1.0

@tjholowaychuk

npmSnykSocket
Downloads:4640034
$ npm install join-component
DailyWeeklyMonthlyYearly

join

Join a list in a nice human friendly way.

Installation

$ component install component/join

API

  • join(arr)
  • join(arr, str)

join(arr)

should default to "and".

join(['foo', 'bar']).should.equal('foo and bar');

join(arr, str)

should join.

join([], 'and').should.equal('');
join(['foo'], 'and').should.equal('foo');
join(['foo', 'bar'], 'and').should.equal('foo and bar');
join(['foo', 'bar', 'raz'], 'or').should.equal('foo, bar or raz');

License

MIT