e13fb6d79eabcd2d9b17fe6cd6fe246d46902db855e35db035110b1ea7805105f9bc1b6b2ab97c4d6aaf2ca942dba0ef4e5f730519c66b5347405d2270c0db 460 B

12345678910111213141516171819202122232425262728293031323334
  1. # flatten
  2. 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.
  3. ## example:
  4. ```js
  5. > var flatten = require('flatten');
  6. undefined
  7. > flatten([1, [2, 3], [4, 5, 6], [7, [8, 9]], 10])
  8. [ 1,
  9. 2,
  10. 3,
  11. 4,
  12. 5,
  13. 6,
  14. 7,
  15. 8,
  16. 9,
  17. 10 ]
  18. > flatten([1, [2, [3, [4, [5]]]]], 2)
  19. [ 1,
  20. 2,
  21. 3,
  22. [ 4, [ 5 ] ] ]
  23. ```
  24. ## install:
  25. npm install flatten
  26. ## license:
  27. MIT/X11.