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.
chunk-async
Advanced tools
Helps to chunk data and resolve async work to large datasets
Features
npm install chunk-async
Chunks array[....] of data into array[[..]‚[..]]
const { chunk, chunkAndResolve, resolve } = require('async-work');
let items = [1,2,3,4,5,6,7,8,9,10];
let chunkSize = 2;
let chunks = chunk(items, chunkSize);
console.log(chunks)
// [ [1,2], [3,4], [5,6], [7,8], [9,10] ]
Resolves async work done on items
const { resolve } = require('async-work');
const axios = require('axios').default;
let items = [1,2,3,4,5,6,7,8,9,10];
// Example async work
let asyncWork = async (item)=>{
let url = `https://jsonplaceholder.typicode.com/posts/${item}`;
let result = await axios.get(url);
return result.data
};
resolve(items, asyncWork).then(res=>{
console.log(res)
// Items from api
});
Chunk and resolve async work, chunk by chunk
const { chunkAndResolve } = require('async-work');
const axios = require('axios').default;
let persons = [{id: 1, name: 'John'}, ... {id:10000, name: 'Mark'}]; // Large dataset
let chunkSize = 100;
let showDebug = true;
let asyncWork = async(person)=>{
let result = await axios.get(`http://yourApi.com/getFullnameById/${person.id}`);
person.fullname = result.data;
return person;
};
chunkAndResolve(persons, chunkSize, asyncWork, showDebug).then(result=>{
console.log(result)
// [ {id:1, name: 'John', fullname: 'John Doe'}, ...]
})
FAQs
Helps to chunk data and resolve async work on large datasets
The npm package chunk-async receives a total of 1 weekly downloads. As such, chunk-async popularity was classified as not popular.
We found that chunk-async 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.