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

run-waterfall-until

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

run-waterfall-until

Like run-waterfall but tasks can break out of the loop.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-88.89%
Maintainers
1
Weekly downloads
 
Created
Source

NPM version Build Status Dependency Status

run-waterfall-until

Like run-waterfall but tasks can break out of the loop.

Install

$ npm install --save run-waterfall-until

Usage

run-waterfal-until processes the list of tasks one by one, ending processing as soon as one of the tasks says so. The next task is invoked with arguments set by the previous task. It is a cross between async operations: waterfall and some.

const waterfallUntil = require('run-waterfall-until');


waterfallUntil([
  function (arg1, arg2, callback) {
    // arg1 now equals 'foo', and arg2 - 'bar'
    // false means continue
    callback(null, false, 'one', 'two');
  },
  function (arg1, arg2, callback) {
    // arg1 now equals 'one', and arg2 - 'two'
    // true means break out of the loop
    callback(null, true, 'three');
  },
  function (arg1, callback) {
    // this function is not called since previous one has called callback with 'true' 
    callback(null, 'done', 'wohoo');
  }
], 'foo', 'bar', function (err, result1) {
   // result1 now equals 'three'
});

License

MIT © Damian Krzeminski

Keywords

FAQs

Package last updated on 13 Feb 2024

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