
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
combine-result
Advanced tools
Combine a few call to a single result which it's returned by first call.
Consider you have a few requests to reads a same file that is very huge let's say it about 1GB and assume it's a fixed file; in that case, u don't want to read the file in each request, so let's combine those requests to read the file just once.
const readFile = path => {
return new Promise(resolve => {
setTimeout(() => resolve('huge content'), 1000); // 1Gb file, read it cost 1000ms
});
};
const combine = requrie('combine-result')();
const readFileCombined = path => {
return combine(path, () => readFile(path));
}
// The following three will combine, read 'a.txt' and return it three times
readFileCombined('a.txt').then(val => console.log(val), err => console.log(err));
readFileCombined('a.txt').then(val => console.log(val), err => console.log(err));
readFileCombined('a.txt').then(val => console.log(val), err => console.log(err));
// The following two are combined
readFileCombined('b.txt').then(val => console.log(val), err => console.log(err));
readFileCombined('b.txt').then(val => console.log(val), err => console.log(err));
setTimeout(() => {
// Reread 'a.txt' since lastest read 'a.txt' calls has returned.
readFileCombined('a.txt').then(val => console.log(val), err => console.log(err));
// The following three are combined
readFileCombined('c.txt').then(val => console.log(val), err => console.log(err));
readFileCombined('c.txt').then(val => console.log(val), err => console.log(err));
readFileCombined('c.txt').then(val => console.log(val), err => console.log(err));
}, 1500);
FAQs
Combine result
The npm package combine-result receives a total of 0 weekly downloads. As such, combine-result popularity was classified as not popular.
We found that combine-result 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.