
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@obi-tec/memory-cache
Advanced tools
Memory Cache is a TypeScript library for caching data in memory to improve the performance of your applications.
Memory Cache is a TypeScript library for in-memory caching. It provides a simple and efficient way to store and retrieve data in memory, improving the performance of your applications.
To install the library, use npm or yarn:
npm install @obi-tec/memory-cache
Here's a basic example of how to use Memory Cache TS:
import MemoryCache from '@obi-tec/memory-cache';
// Set a value in the cache
MemoryCache.set<number>('key', 123, 60); // The value will expire in 60 seconds
// Get a value from the cache
const value = MemoryCache.get('key');
console.log(value); // Output: 123
// Delete a value from the cache
MemoryCache.del('key');
set<T>(key: string, value: T, ttl?: number): voidStores a value in the cache with an optional TTL (Time to Live).
key: The key to store the value under.value: The value to store.ttl: Optional. The time in seconds before the value expires. Default value is 60 seconds.get<T>(key: string): T | undefinedRetrieves a value from the cache.
key: The key of the value to retrieve.undefined if the key does not exist in the cache.del(key: string): voidDeletes a value from the cache.
key: The key of the value to delete.flush(): voidFlushes the entire cache, removing all entries.
keys(): string[]Returns an array of all keys currently stored in the cache.
getTTL(key: string): number | undefinedRetrieves the remaining TTL (Time to Live) for a given key.
key: The key of the value to check the TTL for.undefined if the key does not exist or has no TTL set.setTTL(key: string, ttl: number): voidUpdates the TTL (Time to Live) for an existing cache entry.
key: The key of the value to update the TTL for.ttl: The new TTL in seconds.Contributions are welcome! Please open an issue or submit a pull request on GitHub.
This project is licensed under the Apache License.
FAQs
Memory Cache is a TypeScript library for caching data in memory to improve the performance of your applications.
We found that @obi-tec/memory-cache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.