🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

node-cache-helper

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-cache-helper - npm Package Compare versions

Comparing version
0.0.2
to
0.0.3
+1
-1
package.json
{
"name": "node-cache-helper",
"version": "0.0.2",
"version": "0.0.3",
"description": "",

@@ -5,0 +5,0 @@ "main": "lib/cache.js",

@@ -19,2 +19,6 @@ # NodeCacheHelper

## Notice
Key DO NOT contain `_`
## Usage

@@ -32,2 +36,10 @@

let d = await instance.get('Videos') // d = A
// With Special Args
// split key with `_` and send them as args of function
async function getUser(id) { return id }
instance.register('User', (id) => singleflight.Do('User_' + id, () => getUser(id)))
let d1 = await instance.get('User_1') // d1 = 1
let d2 = await instance.get('User_2') // d2 = 2
let d3 = await instance.get('User_tmp') // d3 = tmp
```