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

cb-buffer

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cb-buffer

A minimalist NodeJS module for callback buffering.

  • 1.0.0
  • Source
  • npm
  • Socket score

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

callback-buffering

cb-buffer - A minimalist NodeJS module for callback buffering.

Installation

Run the following commands to download and install the application:

$  clone  callback-buffering
$ cd callback-buffering
$ npm install

Documentation

CbBuffer()

Creates a new instance of CbBuffer.

Example:

var cb = new CbBuffer();

Return

  • Object The CbBuffer instance containing:
  • done (Function)
  • wait (Function)
  • callback (Function)
  • add (Function)
  • buffer (Array): An array with functions that will be called when the callback method is called.
  • isWaiting (Boolean): A flag that is true after calling the wait method.

done(clb)

Calls the callback function provided as the first parameter with cached arguments.

Params

  • Function clb: The callback function to be called.

Return

  • Object The CbBuffer instance.

wait()

Sets isWaiting flag to true.

Return

  • Object The CbBuffer instance.

callback()

Fires all callbacks from the buffer end empties the it.

Return

  • Object The CbBuffer instance.

add(func)

Adds functions to the current buffer.

Params

  • Function func: The function that should be buffered.

Return

  • Object The CbBuffer instance.

How to contribute

  1. File an issue in the repository, using the bug tracker, describing the contribution you'd like to make. This will help us to get you started on the right foot.
  2. Fork the project in your account and create a new branch: your-great-feature.
  3. Commit your changes in that branch.
  4. Open a pull request, and reference the initial issue in the pull request message.

License

See the LICENSE file.

Keywords

FAQs

Package last updated on 27 Nov 2014

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