Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

join-component

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

join-component

Join a list

  • 1.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1.2M
decreased by-4.47%
Maintainers
1
Weekly downloads
 
Created
Source

join

Join a list in a nice human friendly way.

Installation

$ component install component/join

API

  • join(arr)
  • join(arr, str)
  • join(arr, str) with Oxford comma

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', 'baz'], 'or').should.equal('foo, bar or baz');

join(arr, str) with Oxford comma

should remove comma with less than 3 items.

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

should join with 3 or more items.

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

License

MIT

FAQs

Package last updated on 30 Dec 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc