Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Control flow for ES7 async/await with async.js (v2) signatures
async-aa provide javascript async/await equivalent signatures of the excellent async workflow library.
Module are exported in standard commonJS module format and written in pure ES7 strict format. (no transpilation required nor used). Use browserify if you need async-aa modules in a browser environnement.
async-aa is not a wrapper on async, but rather leverages the full potential of native async/await & promises contract. Code tend to be small & very efficient (far more simplier than using callbacks), just give async-aa/queue.js a look
Nothing special here
// = eachLimit concurrency = 1
// = eachLimit concurrency = arr.length
Nothing special here neither
// = eachOfLimit concurrency = 1
// = eachOfLimit concurrency = dict.length
const eachLimit = require('async-aa/eachLimit');
(async function *() {
var stuffs = [1,2,3, 5, 7]
await eachLimit(stuffs, 2, function*(id){
await dootherStuffs(id);
});
})();
Call a function in javascript next tick (using setImmediate API, or timeout 0 pollyfill)
Return a QueueObject you can push task into.
Wait for thunk to process task (wait for worker, if needed)
const queue = require('async-aa/queue');
const fetch = require('node-fetch');
var q = queue(fetch, 1); //let's be nice
co(function *() {
await q.push("http://example.com/stuff.json");
});
co(function *() {
await q.push("http://example.com/otherstuff.json"); //will wait for stuff to be retrieved
});
Throttle any function that return a promise, sugar syntax helper for async-aa/queue
const throttle = require('async-aa/throttle');
var fetch = require('node-fetch');
fetch = throttle(fetch, 1); //make fetch behave nicely
co(function *() {
await fetch("http://example.com/stuff.json");
});
co(function *() {
await fetch("http://example.com/otherstuff.json"); //will wait for stuff.json to be retrieved
});
async-aa is tested against async test suite.
async/await, async-aa, promise, Promises, await, async, queue, map, throttle, "Let's have a beer & talk in Paris"
FAQs
ES7 control flow with async.js (v2) signatures
The npm package async-aa receives a total of 1 weekly downloads. As such, async-aa popularity was classified as not popular.
We found that async-aa 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.