
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
An in-memory cache module.
const NodeMemo = require('node-memo');
(async function () {
const cache = new NodeMemo(NodeMemo.Second * 5);
cache.set('key', 'value');
console.log(cache.get('key')); // 'value'
await NodeMemo.wait(NodeMemo.Second * 5);
console.log(cache.get('key')); // null
})();
Create a cache.
Param | Type | Description |
---|---|---|
maxAge | number | The max age of the cache. |
number
Get the max age of the cache.
Kind: instance property of NodeMemo
Set the max age of the cache.
Kind: instance property of NodeMemo
Param | Type | Description |
---|---|---|
newAge | number | The new max age of the cache. |
*
Get the value for the specified key in the cache.
Kind: instance method of NodeMemo
Param | Type | Description |
---|---|---|
key | * | The key tied to the data in the cache. |
Set a key and value in the cache.
Kind: instance method of NodeMemo
Param | Type | Description |
---|---|---|
key | * | The key tied to the value in the cache. |
value | * | The value tied to the key in the cache. |
Delete an entry in the cache.
Kind: instance method of NodeMemo
Param | Type | Description |
---|---|---|
key | * | The key tied to the value in the cache. |
boolean
Check if a key-value pair exists in the cache.
Kind: instance method of NodeMemo
Param | Type | Description |
---|---|---|
key | * | The specified key in the cache. |
*[]
Get the keys in the cache.
Kind: instance method of NodeMemo
*[]
Get the values in the cache.
Kind: instance method of NodeMemo
*[]
Get the entries in the cache.
Kind: instance method of NodeMemo
number
Get the current time of a cached item.
Kind: instance method of NodeMemo
Param | Type | Description |
---|---|---|
key | * | The specified key in the cache. |
Clear the cache.
Kind: instance method of NodeMemo
number
Get 1 second in milliseconds.
Kind: static property of NodeMemo
number
Get 1 minute in milliseconds.
Kind: static property of NodeMemo
number
Get 1 hour in milliseconds.
Kind: static property of NodeMemo
number
Get 1 day in milliseconds.
Kind: static property of NodeMemo
Promise
Wait a set amount of time.
Kind: static property of NodeMemo
Param | Type | Description |
---|---|---|
ms | number | The amount of time to wait in milliseconds. |
FAQs
An in-memory cache module.
We found that node-memo 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
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.