Socket
Book a DemoInstallSign in
Socket

crazy_glue

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crazy_glue

Binding all of your async calls together

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

Crazy Glue

Build Status

Allows you to pull together multiple async calls together.

Usage

Basic


var CrazyGlue = require('crazy_glue');

var glue = new CrazyGlue(3);

glue.ok('1', 'hello');
glue.ok('2', 'world');
glue.ok('3', 'test');
glue.ok('3', 'test2');

glue.on('done', function(errors, results) {
  // Do something with arguments
});

results will be


{ 1: 'hello', 2: 'world', 3: ['test', 'test2'] }

errors will be


{ }

With errors


var CrazyGlue = require('crazy_glue');

var glue = new CrazyGlue(3);

glue.ok('1', 'hello');
glue.error('world', 'failed');
glue.error('test', 'failed');
glue.error('test', 'failed2');

glue.on('done', function(errors, results) {
  // Do something with arguments
});

results will be


{ 1: 'hello' }

errors will be


{ world: 'failed', test: ['failed', 'failed2']}

With stats


var CrazyGlue = require('crazy_glue');

var glue = new CrazyGlue(5);

glue.ok('1', 'hello');
glue.ok();
glue.error('world', 'failed');
glue.error('test', 'failed');
glue.error();

glue.on('done', function(errors, results, stats) {
  // stats.okCount == 2
  // stats.errorCount == 3
});

results will be


{ 1: 'hello' }

errors will be


{ world: 'failed', test: 'failed'}

Keywords

binding

FAQs

Package last updated on 23 Aug 2013

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