Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
async-method
Advanced tools
Makes async methods work with callbacks and promises. You have a function on your class that expects a callback as last parameter? Wrap it using the asyncMethod and it returns a promise if the callback is omitted.
npm i async-method
// create a class
var MyClass = new Class({
multiply: asyncMethod(function(a, b, callback) {
process.nextTick(function() {
callback(null, a*b);
});
})
});
var myClassInstance = new MyClass();
// classic callback
myClassInstance.multiply(3, 5, function(err, result) {
});
// es6 promise
myClassInstance.multiply(3, 5).then(function(result) {
}).catch(function(err) {
});
FAQs
Makes async methods work with callbacks and promises
We found that async-method 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.