Gathering detailed insights and metrics for async-box
Gathering detailed insights and metrics for async-box
Gathering detailed insights and metrics for async-box
Gathering detailed insights and metrics for async-box
npm install async-box
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
34 Commits
3 Watching
1 Branches
1 Contributors
Updated on 17 Jun 2016
JavaScript (99.59%)
HTML (0.41%)
Cumulative downloads
Total Downloads
Last day
0%
7
Compared to previous day
Last week
600%
7
Compared to previous week
Last month
1,000%
11
Compared to previous month
Last year
-51.9%
166
Compared to previous year
4
AsyncBox is a library for your main application
object, it supports Sync and Async APIs
Requires runtime with Map
and Promise
APIs available.
Node 4+ and evergreen browsers are the best option.
Promise
can be polifilled with Bluebird library.
App object provides own API plus evented EventEmitter
API
npm install async-box
1// create app object 2var AsyncBox = require('async-box'); 3var app = new AsyncBox();
1app.respondAsync('some-request-name', function(requestData) { 2 // response can be any plain JavaScript value, object or ... 3 return 'response-text'; 4}); 5 6app.respondAsync('async-promise-request', function(requestData) { 7 // ... or Promise 8 return new Promise(function(resolve, reject) { 9 resolve('response-promise'); 10 }); 11}); 12 13app.requestAsync('some-request-name').then(function(response) { 14 console.log(response); // -> 'response-text' 15}); 16 17app.requestAsync('async-promise-request').then(function(response) { 18 console.log(response); // -> 'response-promise' 19});
1app.respondSync('some-sync-request', function(request-data) { 2 // response is any valid JavaScript value 3 return 'some-response-value'; 4}); 5 6const response = app.requestSync('some-sync-request'); 7console.log(response); // -> 'some-response-value'
1app.respondAsync('request-type-one', function(requestData) { 2 console.log(requestData); // -> { key: 'some-value' } 3 // it could be any amount of code here, 4 // the main rule is to return a Promise 5 return new Promise(function(resolve, reject) { 6 resolve('one'); 7 }); 8}); 9 10app.respondAsync('request-type-two', function(requestData) { 11 console.log(requestData); // -> { key: 'other-value' } 12 return new Promise(function(resolve, reject) { 13 resolve('two'); 14 }); 15}); 16 17app.requestAllAsync([ 18 ['request-type-one', { key: 'some-value' }], 19 ['request-type-two', { key: 'other-value' }], 20]).then(function(results) { 21 console.log(results); // -> ['one', 'two'] 22});
1app.respondSync('sync-request-one', function(requestData) { 2 console.log(requestData); // -> { key: 'sync-one' } 3 return 'sync-one'; 4}); 5 6app.respondSync('sync-request-two', function(requestData) { 7 console.log(requestData); // -> { key: 'sync-two' } 8 return 'sync-two'; 9}); 10 11const responses = app.requestAllSync([ 12 ['sync-request-one', { key: 'sync-one' }], 13 ['sync-request-two', { key: 'sync-two' }], 14]); 15 16console.log(responses); // ['sync-one', 'sync-two']
MIT © Yury Solovyov
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More