Sha256: 93e48966216635b27a13ea3de693452de3f3a74c8363eb05c425d1fe16d69b5f

Contents?: true

Size: 1.8 KB

Versions: 14

Compression:

Stored size: 1.8 KB

Contents

# arr-flatten [![NPM version](https://badge.fury.io/js/arr-flatten.svg)](http://badge.fury.io/js/arr-flatten)  [![Build Status](https://travis-ci.org/jonschlinkert/arr-flatten.svg)](https://travis-ci.org/jonschlinkert/arr-flatten) 

> Recursively flatten an array or arrays. This is the fastest implementation of array flatten.

Why another flatten utility? I wanted the fastest implementation I could find, with implementation choices that should work for 95% of use cases, but no cruft to cover the other 5%.

## Run benchmarks

```bash
npm run benchmarks
```

Benchmark results comparing this library to [array-flatten]:

```bash
#1: large.js
  arr-flatten.js x 487,030 ops/sec ±0.67% (92 runs sampled)
  array-flatten.js x 347,020 ops/sec ±0.57% (98 runs sampled)

#2: medium.js
  arr-flatten.js x 1,914,516 ops/sec ±0.76% (94 runs sampled)
  array-flatten.js x 1,391,661 ops/sec ±0.63% (96 runs sampled)

#3: small.js
  arr-flatten.js x 5,158,980 ops/sec ±0.85% (94 runs sampled)
  array-flatten.js x 3,683,173 ops/sec ±0.79% (97 runs sampled)
```

## Run tests

Install dev dependencies:

```bash
npm i -d && npm test
```

## Install with [npm](npmjs.org)

```bash
npm i arr-flatten --save
```
### Install with [bower](https://github.com/bower/bower)

```bash
bower install arr-flatten --save
```


## Usage

```js
var flatten = require('arr-flatten');

flatten(['a', ['b', ['c']], 'd', ['e']]);
//=> ['a', 'b', 'c', 'd', 'e']
```

## Author

**Jon Schlinkert**
 
+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) 

## License
Copyright (c) 2014-2015 Jon Schlinkert  
Released under the MIT license

***

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 11, 2015._

[array-flatten]: https://github.com/blakeembrey/array-flatten

Version data entries

14 entries across 14 versions & 5 rubygems

Version Path
lanes-0.8.0 node_modules/arr-flatten/README.md
brwy_rails-0.0.6 test/dummy/node_modules/arr-flatten/README.md
brwy_rails-0.0.5 test/dummy/node_modules/arr-flatten/README.md
blackboard-3.1.9 lib/site_template/node_modules/arr-flatten/README.md
brwy_rails-0.0.4 test/dummy/node_modules/arr-flatten/README.md
brwy_rails-0.0.3 test/dummy/node_modules/arr-flatten/README.md
brwy_rails-0.0.2 test/dummy/node_modules/arr-flatten/README.md
brwy_rails-0.0.1 test/dummy/node_modules/arr-flatten/README.md
es6_tilt-0.1.2 test/dummy/app/assets/javascripts/node_modules/arr-flatten/README.md
es6_tilt-0.1.1 test/dummy/app/assets/javascripts/node_modules/arr-flatten/README.md
es6_tilt-0.1.0 test/dummy/app/assets/javascripts/node_modules/arr-flatten/README.md
gulp_assets-1.0.0.pre.5 template/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/node_modules/arr-diff/node_modules/arr-flatten/README.md
gulp_assets-1.0.0.pre.4 template/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/node_modules/arr-diff/node_modules/arr-flatten/README.md
gulp_assets-1.0.0.pre.3 template/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/node_modules/arr-diff/node_modules/arr-flatten/README.md