reduce-flatten
Advanced tools
Comparing version
{ | ||
"name": "reduce-flatten", | ||
"author": "Lloyd Brookes <75pound@gmail.com>", | ||
"version": "2.0.0", | ||
"description": "Flatten an array into the supplied array.", | ||
"repository": "https://github.com/75lb/reduce-flatten.git", | ||
"version": "3.0.0", | ||
"description": "Isomorphic map-reduce function to flatten an array into the supplied array", | ||
"repository": "https://github.com/75lb/reduce-flatten", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"module": "index.mjs", | ||
"keywords": [ | ||
@@ -14,12 +16,23 @@ "array", | ||
"engines": { | ||
"node": ">=6" | ||
"node": ">=8" | ||
}, | ||
"scripts": { | ||
"test": "test-runner test.js", | ||
"docs": "jsdoc2md -t README.hbs index.js > README.md; echo" | ||
"test": "npm run dist && test-runner test.js", | ||
"docs": "jsdoc2md -c jsdoc.conf -t README.hbs index.mjs > README.md", | ||
"dist": "rollup -f umd -n flatten -o dist/index.js index.mjs" | ||
}, | ||
"devDependencies": { | ||
"jsdoc-to-markdown": "^4.0.1", | ||
"test-runner": "^0.5.0" | ||
"jsdoc-to-markdown": "^5.0.1", | ||
"rollup": "^1.22.0", | ||
"test-runner": "^0.6.0" | ||
}, | ||
"files": [ | ||
"index.mjs", | ||
"dist/index.js" | ||
], | ||
"standard": { | ||
"ignore": [ | ||
"dist" | ||
] | ||
} | ||
} |
[](https://www.npmjs.org/package/reduce-flatten) | ||
[](https://www.npmjs.org/package/reduce-flatten) | ||
[](https://travis-ci.org/75lb/reduce-flatten) | ||
[](https://david-dm.org/75lb/reduce-flatten) | ||
[](https://david-dm.org/75lb/reduce-flatten) | ||
[](https://github.com/feross/standard) | ||
@@ -10,3 +10,3 @@ | ||
## reduce-flatten | ||
Flatten an array into the supplied array. | ||
Isomorphic map-reduce function to flatten an array into the supplied array. | ||
@@ -28,4 +28,32 @@ **Example** | ||
### Load anywhere | ||
This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation. | ||
Node.js: | ||
```js | ||
const arrayify = require('reduce-flatten') | ||
``` | ||
Within Node.js with ECMAScript Module support enabled: | ||
```js | ||
import arrayify from 'reduce-flatten' | ||
``` | ||
Within an modern browser ECMAScript Module: | ||
```js | ||
import arrayify from './node_modules/reduce-flatten/index.mjs' | ||
``` | ||
Old browser (adds `window.flatten`): | ||
```html | ||
<script nomodule src="./node_modules/reduce-flatten/dist/index.js"></script> | ||
``` | ||
* * * | ||
© 2016-18 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown). | ||
© 2016-19 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
6252
47.38%52
92.59%58
93.33%3
50%6
-14.29%