1 | # Array Flatten
|
2 |
|
3 | [![NPM version][npm-image]][npm-url]
|
4 | [![NPM downloads][downloads-image]][downloads-url]
|
5 | [![Build status][travis-image]][travis-url]
|
6 | [![Test coverage][coveralls-image]][coveralls-url]
|
7 | [![Bundle size][bundlephobia-image]][bundlephobia-url]
|
8 |
|
9 | > Flatten nested arrays.
|
10 |
|
11 | ## Installation
|
12 |
|
13 | ```
|
14 | npm install array-flatten --save
|
15 | ```
|
16 |
|
17 | ## Usage
|
18 |
|
19 | ```js
|
20 | import { flatten } from "array-flatten";
|
21 |
|
22 | flatten([1, [2, [3, [4, [5], 6], 7], 8], 9]);
|
23 | //=> [1, 2, 3, 4, 5, 6, 7, 8, 9]
|
24 |
|
25 | (function() {
|
26 | flatten(arguments); //=> [1, 2, 3]
|
27 | })(1, [2, 3]);
|
28 | ```
|
29 |
|
30 | ## License
|
31 |
|
32 | MIT
|
33 |
|
34 | [npm-image]: https://img.shields.io/npm/v/array-flatten.svg?style=flat
|
35 | [npm-url]: https://npmjs.org/package/array-flatten
|
36 | [downloads-image]: https://img.shields.io/npm/dm/array-flatten.svg?style=flat
|
37 | [downloads-url]: https://npmjs.org/package/array-flatten
|
38 | [travis-image]: https://img.shields.io/travis/blakeembrey/array-flatten.svg?style=flat
|
39 | [travis-url]: https://travis-ci.org/blakeembrey/array-flatten
|
40 | [coveralls-image]: https://img.shields.io/coveralls/blakeembrey/array-flatten.svg?style=flat
|
41 | [coveralls-url]: https://coveralls.io/r/blakeembrey/array-flatten?branch=master
|
42 | [bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/array-flatten.svg
|
43 | [bundlephobia-url]: https://bundlephobia.com/result?p=array-flatten
|