source: node_modules/array-flatten/README.md@ e48199a

main
Last change on this file since e48199a was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1.2 KB
Line 
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
8> Flatten an array of nested arrays into a single flat array. Accepts an optional depth.
9
10## Installation
11
12```
13npm install array-flatten --save
14```
15
16## Usage
17
18```javascript
19var flatten = require('array-flatten')
20
21flatten([1, [2, [3, [4, [5], 6], 7], 8], 9])
22//=> [1, 2, 3, 4, 5, 6, 7, 8, 9]
23
24flatten([1, [2, [3, [4, [5], 6], 7], 8], 9], 2)
25//=> [1, 2, 3, [4, [5], 6], 7, 8, 9]
26
27(function () {
28 flatten(arguments) //=> [1, 2, 3]
29})(1, [2, 3])
30```
31
32## License
33
34MIT
35
36[npm-image]: https://img.shields.io/npm/v/array-flatten.svg?style=flat
37[npm-url]: https://npmjs.org/package/array-flatten
38[downloads-image]: https://img.shields.io/npm/dm/array-flatten.svg?style=flat
39[downloads-url]: https://npmjs.org/package/array-flatten
40[travis-image]: https://img.shields.io/travis/blakeembrey/array-flatten.svg?style=flat
41[travis-url]: https://travis-ci.org/blakeembrey/array-flatten
42[coveralls-image]: https://img.shields.io/coveralls/blakeembrey/array-flatten.svg?style=flat
43[coveralls-url]: https://coveralls.io/r/blakeembrey/array-flatten?branch=master
Note: See TracBrowser for help on using the repository browser.