flatten
Flatten arbitrarily nested arrays into a non-nested list of non-array items. Maintained for legacy compatibility.
Last updated 8 months ago by mk-pmb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install flatten 
SYNC missed versions from official npm registry.

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:

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

Current Tags

  • 1.0.3                                ...           latest (8 months ago)

6 Versions

  • 1.0.3                                ...           8 months ago
  • 1.0.2 [deprecated]           ...           4 years ago
  • 1.0.1 [deprecated]           ...           4 years ago
  • 1.0.0 [deprecated]           ...           4 years ago
  • 0.0.1 [deprecated]           ...           8 years ago
  • 0.0.0 [deprecated]           ...           8 years ago
Downloads
Today 412
This Week 53,606
This Month 27,207
Last Day 13,540
Last Week 59,617
Last Month 309,433
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (275)

Copyright 2014 - 2016 © taobao.org |