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

@sealsystems/droddel

Package Overview
Dependencies
Maintainers
4
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sealsystems/droddel

Serialize asynchronous calls

  • 2.2.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

@sealsystems/droddel

CircleCI AppVeyor

Serialize asynchronous calls.

Installation

$ npm install @sealsystems/droddel

Quick start

First you need to add a reference to seal-droddel within your application.

const droddel = require('@sealsystems/droddel');

To actually throttle a function, call droddel and hand over the function that shall be throttled.

E.g., if you want to serialize read access to a file, hand over a function that does the actual reading and returns its result as a promise:

const readFile = util.promisify(fs.readFile);

const throttledRead = droddel(
  async () => await readFile('/etc/passwd'));

To then read the file, simply call throttledRead:

const result = await throttledRead();

If you call throttledRead while it is already being run, the new call gets delayed.

Running the build

To build this module use roboter.

$ bot

FAQs

Package last updated on 16 Jan 2021

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