Socket
Socket
Sign inDemoInstall

arr-flatten

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    arr-flatten

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


Version published
Weekly downloads
12M
decreased by-1.52%
Maintainers
1
Install size
6.71 kB
Created
Weekly downloads
 

Package description

What is arr-flatten?

The arr-flatten npm package is a utility for flattening nested arrays into a single-level array. It is a simple and focused package that does not handle arguments other than arrays (e.g., it does not flatten array-like objects).

What are arr-flatten's main functionalities?

Flatten nested arrays

This feature allows you to flatten a deeply nested array into a single-level array. The code sample demonstrates how to use the `.flat()` method to flatten an array with multiple levels of nesting.

[1, [2, [3, [4]], 5]].flat()

Other packages similar to arr-flatten

Readme

Source

arr-flatten NPM version

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

Why another flatten utility? Because this one is faster.

Run benchmarks

node benchmark

Run tests

npm test

Install

Install with npm
npm i arr-flatten --save
Install with bower
bower install arr-flatten --save

Usage

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

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

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license


This file was generated by verb-cli on November 09, 2014.

Keywords

FAQs

Last updated on 09 Nov 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc