npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

abbado

v0.0.8

Published

Conductor for concurrent async control flow

Downloads

9

Readme

abbado

Conductor for concurrent async control flow. Simple way to stop all concurrent task-running flows without aborting currently running tasks. Also it's a good way to pause all flows at the same time from one place of code.

Build Status NPM version

Install

npm i abbado

Usage

const abbado = require('abbado');
const _ = abbado(options);

methods:

  • stopped - returns false if control flow is not stopped and stats object otherwise.
  • stop - manually stop control flow (if not stopped yet) and reset pause (if paused). Optional parameter is a custom stats object or string for status field of stats object. Returns stats object.
  • pause - set flows on pause (only parameter - pause length in ms).
  • resume - alias for pause(0).
  • wait - waits for pause finish. Actually returns promise, that resolves after pause finished or immediately if there is no pause or if already stopped. If pause will be changed after waiting started, promise will wait for new pause length before resolve. If stop or resume will be called after waiting started, promise will resolve immediately.
  • error - reports error. Optional parameter is string tag, describing kind of error. Returns array of two numbers: number of all reported errors and number of errors with same tag (or null if no tag).
  • paused - feturns true or false whether control flow is paused or not.

options:

  • timeout - time in milliseconds time in milliseconds, after which control flow will be stopped.
  • count - number limiting how many times stopped may return false.
  • errorLimit - number limiting how many errors may be reported by error method before control flow will be stopped.
  • tagErrorLimit - same as errorLimit but for any single tag.

example:

console.log(_.stopped()); //false
_.pause(1000);
_.wait()
    .then(doSomethingAfter1000ms)
    .then(() => _stop())
    .then(() => console.log(_.stopped())); //{status: 'stopped manually'}

License

MIT