New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@flatten/array

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flatten/array - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

8

CHANGES.md

@@ -0,3 +1,11 @@

## 1.0.1 - 2017/04/23
1. add more implementations to compare to
2. display this library's implementation name as the npm package name
3. use custom `benchmarked` to allow formatting output with color
4. update performance screenshot with new results
5. update README with new info
## 1.0.0 - 2017/04/23
1. initial working version with tests, 100% code coverage, and performance benchmarking.

9

package.json
{
"name": "@flatten/array",
"version": "1.0.0",
"version": "1.0.1",
"description": "Quickly flatten an array in-place.",

@@ -36,12 +36,17 @@ "main": "lib/index.js",

"@optimal/fn": "^0.1.0",
"arr-flatten": "^1.0.3",
"array-flatten": "^2.1.1",
"benchmarked": "^1.0.0",
"coffee-script": "^1.12.5",
"compute-flatten": "^1.0.0",
"coveralls": "^2.13.0",
"eslint": "^3.19.0",
"flatten": "^1.0.2",
"flatten-array": "^1.0.0",
"istanbul": "^0.4.5",
"just-flatten-it": "^1.1.23",
"mocha": "^3.2.0",
"mocha-lcov-reporter": "^1.3.0",
"nave": "^2.2.3"
"nave": "^2.2.3",
"reduce-flatten": "^1.0.1"
},

@@ -48,0 +53,0 @@ "dependencies": {},

@@ -9,7 +9,19 @@ # @flatten/array

View [many implementation variations](https://github.com/elidoran/array-flatten/tree/add-more/benchmark/code/flatten) and use it to run benchmarks. This implementation is named `inplace2.js` there.
Fastest implementation when compared to several published packages and many unpublished variations.
Run `npm run perf` to compare the performance of this implementation to both [array-flatten](https://www.npmjs.com/package/array-flatten) and [flatten-array](https://www.npmjs.com/package/flatten-array).
View [many implementation variations](https://github.com/elidoran/array-flatten/tree/add-more/benchmark/code/flatten) and use it to run benchmarks. This package's implementation is named `inplace2.js` there.
For this repo, run `npm run perf` to compare the performance of this implementation to:
1. [arr-flatten](https://www.npmjs.com/package/arr-flatten)
2. [array-flatten](https://www.npmjs.com/package/array-flatten)
3. [compute-flatten](https://www.npmjs.com/package/compute-flatten)
4. [flatten-array](https://www.npmjs.com/package/flatten-array)
5. [flatten](https://www.npmjs.com/package/flatten)
6. [just-flatten-it](https://www.npmjs.com/package/just-flatten-it)
7. [reduce-flatten](https://www.npmjs.com/package/reduce-flatten).
See screenshot of [performance results](#screenshot) below.
## Install

@@ -44,3 +56,3 @@

An in-place flatten on the top-most array is significantly faster than producing a new array with the flattened results. Run this project's performance test to see it compared to both [array-flatten](https://www.npmjs.com/package/array-flatten) and [flatten-array](https://www.npmjs.com/package/flatten-array).
An in-place flatten on the top-most array is significantly faster than producing a new array with the flattened results. Run this project's performance test to see it compared to the implementations listed above.

@@ -65,2 +77,5 @@ Also, use [my fork](https://github.com/elidoran/array-flatten/tree/add-more/benchmark/code/flatten) of the `array-flatten` project to compare this implementation, called `inplace2.js` there, against many other implementations.

### Screenshot
Performance results screenshot shows this implementation is significantly faster than the other two:

@@ -67,0 +82,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc