# flatten

> Flatten arbitrarily nested arrays into a non-nested list of non-array items. Maintained for legacy compatibility.

Latest version **1.0.3** (published 2019-10-31) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install flatten
pnpm add flatten
yarn add flatten
bun add flatten
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-10-31 |
| First published | 2012-06-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Joshua Holbrook |
| Maintainers | jesusabdullah, jfhbrook, mk-pmb |
| Keywords | array, flatten |

## Links

- npm: https://www.npmjs.com/package/flatten
- Repository: https://github.com/mk-pmb/flatten-js
- Homepage: https://github.com/mk-pmb/flatten-js/#readme
- Issues: https://github.com/mk-pmb/flatten-js/issues
- npm.io page: https://npm.io/package/flatten

## Recent versions

- 1.0.3 (latest) — 2019-10-31
- 1.0.2 — 2016-01-20
- 1.0.1 — 2016-01-20
- 1.0.0 — 2016-01-20
- 0.0.1 — 2012-06-28
- 0.0.0 — 2012-06-28

## README

# flatten

A tiny utility to flatten arrays of arrays (of arrays, etc., recursively, infinitely or to an optional depth) into a single array of non-arrays.

## example:

```js
> var flatten = require('flatten');
undefined
> flatten([1, [2, 3], [4, 5, 6], [7, [8, 9]], 10])
[ 1,
  2,
  3,
  4,
  5,
  6,
  7,
  8,
  9,
  10 ]
> flatten([1, [2, [3, [4, [5]]]]], 2)
[ 1,
  2,
  3,
  [ 4, [ 5 ] ] ]
```

## install:

    npm install flatten

## license:

MIT/X11.

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