Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

steed

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

steed

horsepower for your modules

  • 1.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
139K
decreased by-5.5%
Maintainers
1
Weekly downloads
 
Created

What is steed?

The 'steed' npm package is a utility library designed to handle asynchronous control flow, similar to the popular 'async' library. It provides a set of functions to manage asynchronous operations in a more readable and maintainable way.

What are steed's main functionalities?

parallel

The 'parallel' function allows you to run multiple asynchronous tasks in parallel. The final callback is executed once all tasks have completed.

const steed = require('steed');

steed.parallel([
  function(callback) {
    setTimeout(() => {
      console.log('Task 1');
      callback(null, 'one');
    }, 200);
  },
  function(callback) {
    setTimeout(() => {
      console.log('Task 2');
      callback(null, 'two');
    }, 100);
  }
], function(err, results) {
  console.log(results); // ['one', 'two']
});

series

The 'series' function runs asynchronous tasks in series, meaning each task waits for the previous one to complete before starting.

const steed = require('steed');

steed.series([
  function(callback) {
    setTimeout(() => {
      console.log('Task 1');
      callback(null, 'one');
    }, 200);
  },
  function(callback) {
    setTimeout(() => {
      console.log('Task 2');
      callback(null, 'two');
    }, 100);
  }
], function(err, results) {
  console.log(results); // ['one', 'two']
});

waterfall

The 'waterfall' function runs asynchronous tasks in series, passing the result of each task to the next one in the array.

const steed = require('steed');

steed.waterfall([
  function(callback) {
    setTimeout(() => {
      console.log('Task 1');
      callback(null, 'one');
    }, 200);
  },
  function(arg1, callback) {
    setTimeout(() => {
      console.log('Task 2');
      callback(null, 'two');
    }, 100);
  }
], function(err, result) {
  console.log(result); // 'two'
});

Other packages similar to steed

Keywords

FAQs

Package last updated on 18 Mar 2016

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