# join-component

> Join a list

Latest version **1.1.0** (published 2012-12-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install join-component
pnpm add join-component
yarn add join-component
bun add join-component
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2012-12-30 |
| First published | 2012-12-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | tjholowaychuk |

## Links

- npm: https://www.npmjs.com/package/join-component
- npm.io page: https://npm.io/package/join-component

## Recent versions

- 1.1.0 (latest) — 2012-12-30
- 1.0.0 — 2012-12-18

## README

# join

  Join a list in a nice human friendly way.

## Installation

    $ component install component/join

## API

   - [join(arr)](#joinarr)
   - [join(arr, str)](#joinarr-str)
   - [join(arr, str) with Oxford comma](#joinarr-str-with-oxford-comma)
<a name=""></a>

<a name="joinarr"></a>
# join(arr)
should default to "and".

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

<a name="joinarr-str"></a>
# join(arr, str)
should join.

```js
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');
```

<a name="joinarr-str-with-oxford-comma"></a>
# join(arr, str) with Oxford comma
should remove comma with less than 3 items.

```js
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.

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

## License

  MIT

---
_Source: https://npm.io/package/join-component · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
