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

eachy

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eachy

a tiny (18 lines of code) async each module

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

eachy

A tiny (18 lines of code) async each implementation that supports CommonJS, AMD, and VanillaJS.

Install

npm install eachy
bower install eachy

Usage

asyncEach(array, iterator, callback)

Arguments
  • array - An array to iterate over
  • iterator(item, callback, index) - A function called for each item in the array. The callback(err) takes a single, optional argument, an error. The index value is index of the item in the array.
  • callback(err) - The callback that is called when all iterator functions are finished or an error occurs.

Examples

Browser (No module loader)
<script src="/js/eachy.js"></script>
<script>
  // asyncEach is a global bound to the window object now
  asyncEach(['hi', 'i love', 'alerts'], function(word, done) {
    alert(word);
    done();
  });
</script>
Node.js
var asyncEach = require('eachy');
var fs = require('fs');

asyncEach(['robots.txt', 'todo.txt'], function(file, done) {
  fs.readFile(file, function(err, data) {
    if (err) return done(err);
    console.log(data);
    done();
  });
}, function(err) {
  console.log('You should have all the information you need now.');
});

Keywords

FAQs

Package last updated on 21 May 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc