1
0
mirror of https://github.com/thangisme/notes.git synced 2024-06-28 21:35:34 +00:00
notes/node_modules/flatten/README.md
Patrick Marsceill b7b0d0d7bf
Initial commit
2017-03-09 13:16:08 -05:00

35 lines
460 B
Markdown

# 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.