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.
async-settle
Advanced tools
Changelog
Readme
Settle an async function. It will always complete successfully with an object of the resulting state.
Handles completion and errors for callbacks, promises, observables and streams.
Will run call the function on nextTick
. This will cause all functions to be async.
var asyncSettle = require('async-settle');
asyncSettle(function(done){
// do async things
done(null, 2);
}, function(error, result){
// `error` will ALWAYS be null on execution of the first function.
// `result` will ALWAYS be a settled object with the result or error of the first function.
});
var asyncSettle = require('async-settle');
asyncSettle(function(done){
// do async things
done(new Error('Some Error Occurred'));
}, function(error, result){
// `error` will ALWAYS be null on execution of the first function.
// `result` will ALWAYS be a settled object with the result or error of the first function.
});
asyncSettle(fn, callback)
Takes a function to execute (fn
) and a function to call on completion (callback
).
fn([done])
Optionally takes a callback (done
) to call when async tasks are complete.
Executed in the context of async-done
, with all errors and results being settled.
Completion is handled by async-done
completion and error resolution.
callback(error, result)
Called on completion of fn
and recieves a settled object as the result
argument.
The error
argument will always be null
.
Settled values have two properties, state
and value
.
state
has two possible options 'error'
and 'success'
.
value
will be the value passed to original callback.
MIT
FAQs
Settle an async function.
The npm package async-settle receives a total of 1,334,631 weekly downloads. As such, async-settle popularity was classified as popular.
We found that async-settle demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.