
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
cache-manager-js
Advanced tools
A caching library for managing asynchronous function results with TTL and eviction strategies.
A caching library for managing asynchronous function results with TTL and eviction strategies.
You can install the package using npm:
npm install cache-manager-js
import { AsyncCacheManager } from "scache-manager-js";
const cache = new AsyncCacheManager();
const callCount: any[] = [];
async function fetchDataFromAPI(id: string): Promise<any> {
console.log(
`async function called. ID: ${id} Count: ${callCount.length + 1}`
);
const result = Math.random();
callCount.push(result);
return result;
}
const cachedFetchData = cache.wrap(fetchDataFromAPI);
// The first call triggers the actual async operation
const data1 = await cachedFetchData("123");
// Subsequent calls return cached results without re-executing the async operation
const data2 = await cachedFetchData("123");
const data3 = await cachedFetchData("666");
if (data1 === data2) {
console.log("data1 equals data2");
// data1 equals data2
}
Asynchronous programming is increasingly prevalent in modern JavaScript and TypeScript applications. Creating a sophisticated caching manager for asynchronous operations addresses a common performance optimization challenge. This package could be particularly useful in scenarios where repeated asynchronous calls with similar parameters occur.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
A caching library for managing asynchronous function results with TTL and eviction strategies.
We found that cache-manager-js 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.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.