Socket
Socket
Sign inDemoInstall

apr-for-each

Package Overview
Dependencies
10
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.2 to 1.0.3

readme.md

26

index.js
const each = require('apr-engine-each');
/**
* <a id="for-each"></a>
* Applies the function `iteratee` to each item in `coll`, in parallel.
*
* [![](https://img.shields.io/npm/v/apr-for-each.svg?style=flat-square)](https://www.npmjs.com/package/apr-for-each) [![](https://img.shields.io/npm/l/apr-for-each.svg?style=flat-square)](https://www.npmjs.com/package/apr-for-each)
*
* @kind function
* @name for-each
* @param {Array|Object|Iterable} input
* @param {Function} iteratee
* @returns {Promise}
*
* @example
* import awaitify from 'apr-awaitify';
* import forEach from 'apr-for-each';
*
* const writeFile = awaitify(fs.writeFile);
* const files = [
* '/home/.vimrc',
* '/home/.zshrc'
* ];
*
* await forEach(files, async (file) =>
* await writeFile(file, 'boom')
* );
*/
module.exports = (input, fn, opts) => {

@@ -4,0 +30,0 @@ return each({

const defaults = require('lodash.defaults');
const each = require('apr-engine-each');
/**
* @kind function
* @name limit
* @memberof for-each
* @param {Array|Object|Iterable} input
* @param {Number} limit
* @param {Function} iteratee
* @returns {Promise}
*/
module.exports = (input, limit, fn, opts) => {

@@ -5,0 +14,0 @@ return each({

2

package.json
{
"name": "apr-for-each",
"version": "1.0.2",
"version": "1.0.3",
"homepage": "https://github.com/ramitos/apr/tree/master/packages/for-each",

@@ -5,0 +5,0 @@ "license": "MIT",

const limit = require('./limit');
/**
* @kind function
* @name series
* @memberof for-each
* @param {Array|Object|Iterable} input
* @param {Function} iteratee
* @returns {Promise}
*/
module.exports = (input, fn, opts) => {
return limit(input, 1, fn, opts);
};
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