# human-list

> array => human readable list

Latest version **0.0.1** (published 2019-11-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install human-list
pnpm add human-list
yarn add human-list
bun add human-list
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2019-11-23 |
| First published | 2019-11-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | zwhitchcox |

## Links

- npm: https://www.npmjs.com/package/human-list
- Repository: https://github.com/zwhitchcox/human-list
- Homepage: https://github.com/zwhitchcox/human-list#readme
- Issues: https://github.com/zwhitchcox/human-list/issues
- npm.io page: https://npm.io/package/human-list

## Recent versions

- 0.0.1 (latest) — 2019-11-23

## README

# human-list

array => human readable list

`hList(["apples", "oranges", "bananas"], "and") => "apples, oranges, and bananas"`

automatically inserts commas, conjunctions in correct places no matter the length of the list

### installation

`yarn add human-list`

`npm i -S human-list`

### Usage

`hList(array, conjunction) => human readable list`

(a conjunction is a joining word like "and" or "or")

`andList` is syntactic sugar for hList([array], "and")
`orList` is syntactic sugar for hList([array], "or")

```ts
import { hList, andList, orList } from 'human-list'

const list = ["apples", "oranges", "bananas"]


hList(list, "and") // => "apples, oranges, and bananas"
hList(list.slice(0, 2), "and") // => "apples and oranges"
hList(list.slice(0, 1), "and") // => "apples"

andList(list) // => "apples, oranges, and bananas"

orList(list) // => "apples, oranges, or bananas"
```# human-list

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