Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Readme
A simple concurrency pattern: fan-in
Status: Untested in production, but ready to be.
n
asynchronous calls simultaneously and make a callback when all have finished.Usage:
var fanin = require('fanin')
, fan = fanin(number_of_callbacks, final_callback);
asyncCall(fan); // repeat...
asyncCall(fan.capture('field'));
asyncCall(fan.ordered(index));
...
fan.timeout(err)
// final_callback( error_array, return_value_object );
Basic Usage (no return values, just an unorded list of errors):
var fan = fanin(2, cb);
foo(fan);
bar(fan);
function foo(cb) { cb(new Error('some error')); }
function bar(cb) { cb(null); }
// cb([ Error('some error') ]);
Storing return value(s):
var fan = fanin(2, cb);
foo(fan.capture('foo'));
bar(fan.capture('bar'));
function foo(cb) { cb(null, 'foobaz'); }
function bar(cb) { cb(null, 'bar', 'baz'); }
// cb(undefined, { foo: 'foobaz', bar: [ 'bar', 'baz' ] } );
Storing return values in an ordered array:
var fan = fanin(2, cb);
foo(fan.ordered(1));
bar(fan.ordered(0));
function foo(cb) { cb(null, 'foobaz'); }
function bar(cb) { cb(null, 'barbaz'); }
// cb(undefined, { ordered: [ 'barbaz', 'foobaz' ] } );
Timeouts on these calls:
var fan = fanin(2, cb);
fan.timeout(new Error('timeout!'));
// cb([ Error('timeout!') ])
npm install fanin
npm test
MIT License found in the LICENSE file.
FAQs
fanin - the fan-in concurrency pattern
The npm package fanin receives a total of 10 weekly downloads. As such, fanin popularity was classified as not popular.
We found that fanin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.