
Research
Malicious Go “crypto” Module Steals Passwords and Deploys Rekoobe Backdoor
An impersonated golang.org/x/crypto clone exfiltrates passwords, executes a remote shell stager, and delivers a Rekoobe backdoor on Linux.
await-cache
Advanced tools
A cache for async-functions. It also works for non-async functions. It's even possible to enable a LRU-algorithm.
npm i await-cache
Simply surround the async function you want to cache. In this example fetch is a function that loads a file.
const cachify = require('await-cache');
const cachedFetch = cachify(/* function to cache: */fetch, /* cache-time in milliseconds: */ 1000 * 60 * 60)
async function test() {
try {
const data1 = await cachedFetch('foo.bar') // will do the real fetch and cache it for an hour
const data2 = await cachedFetch('foo.bar') // will instantly return the cached value
const data3 = await cachedFetch('foo2.bar') // will fetch a different result and cache it for an hour
} catch(e) {
// fetch throw an error
console.error(e)
}
}
Second argument can be the cache-time in milliseconds or an object of options. With setting the maxSize-option you enable the LRU-Cache:
const cachify = require('await-cache');
const cachedFunc = cachify(async (filename) => {
let data = await fetch(filename)
return JSON.parse(data)
}, {
maxAge: 60 * 60 * 1000, // cache for an hour
maxSize: 2, // enable LRU-cache. Only cache the last 2 used files. The cache will never save more that the result of 2 different arguments.
serialize: (args) => JSON.stringify(args) // use a special argument-serialize-function
})
The default serialisation for the arguments uses JSON.stringify. So you will have to write a custom serialisation if you want to use functions or complex objects as arguments.
FAQs
A simple to use cache for async-functions
The npm package await-cache receives a total of 12 weekly downloads. As such, await-cache popularity was classified as not popular.
We found that await-cache 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
An impersonated golang.org/x/crypto clone exfiltrates passwords, executes a remote shell stager, and delivers a Rekoobe backdoor on Linux.

Security News
npm rolls out a package release cooldown and scalable trusted publishing updates as ecosystem adoption of install safeguards grows.

Security News
AI agents are writing more code than ever, and that's creating new supply chain risks. Feross joins the Risky Business Podcast to break down what that means for open source security.