package
Flatten arbitrarily nested arrays into a non-nested list of non-array items. Maintained for legacy compatibility.
npm install flattenGitHub-flavored package documentation.
Across all versions, last 30 days.
10,418,721 in 30 days
Runtime metadata.
Tagged topics.
Estimated unpacked size across 1 packages.
3.6 kB
Includes dependencies.
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.
> 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 ] ] ]npm install flattenMIT/X11.
mk-pmb-2fa
mk+npmjs+2fa@pimpmybyte.de