Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/frangeris/flatten
Flatten nested array values to a single level
https://github.com/frangeris/flatten
Last synced: 8 days ago
JSON representation
Flatten nested array values to a single level
- Host: GitHub
- URL: https://github.com/frangeris/flatten
- Owner: frangeris
- License: mit
- Created: 2016-07-13T01:50:09.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-07-13T03:20:47.000Z (over 8 years ago)
- Last Synced: 2024-12-08T15:24:23.244Z (29 days ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flatten arrays
This library helps you to flatten nested arrays into a single level array.## Installation
```bash
$ npm install flatten-util --save
```## Usage
```javascript
import flatten from 'flatten-util'let flattened = flatten([[1,[[2,[[3,4,[5]],6],[7]],8],[9]],[[10,11,[12]],13]])
console.log(flattened) // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
```## Tests
To run the test suite, first install the dependencies, then run `npm test`:
```bash
$ npm install
$ npm test
```## License
[MIT](LICENSE)