npm install memory-cache --save Usage varcache=require('memory-cache'); //now just use the cache cache.put('foo','bar'); console.log(cache.get('foo')); //that wasn't too interesting, here's the good part cache.put('houdini','disappear',100,function(key,value){ ...
npm install --save better-memory-cache Usage importCache,{HOUR,MINUTE,SECOND}from'better-memory-cache';// Or using CommonJS require:// const { default: Cache, HOUR, MINUTE, SECOND } = require('better-memory-cache');constfruitCache=newCache<string>({namespace:'fruits',expireAfterMs:1*HOUR...
npm install memory-cache --save Usage varcache = require('memory-cache');//now just use the cachecache.put('foo','bar'); console.log(cache.get('foo'));//that wasn't too interesting, here's the good partcache.put('houdini','disappear',100, function(key, value) { console.log(key...
npm install tinycache Usage var TinyCache = require( 'tinycache' ); var cache = new TinyCache(); // now just use the cache cache.put( 'foo', 'bar' ); console.log( cache.get( 'foo' ) ); // that wasn't too interesting, here's the good part cache.put( 'houdini', 'disappe...
npm install node-cache --save Or just require thenode_cache.jsfile to get the superclass Examples: Initialize (INIT): constNodeCache=require("node-cache");constmyCache=newNodeCache(); Options stdTTL:(default:0)the standard ttl as number in seconds for every generated cache element.0= unlimi...
.npmignore try coveralls github-action instead of coveralls npm package 5年前 .nvmrc update dependencies so npm audit will shut up; update nvmrc to 10.16 6年前 .nycrc.yaml code-coverage: replace deprecated istanbul with nyc 5年前 Gruntfile.coffee fix tests in appveyor, fix tes...
npm install lru-cache 在代码中使用 lru-cache: 下面是一个简单的示例,展示了如何使用 lru-cache 来缓存数据: javascript const LRU = require('lru-cache'); const options = { max: 500, // 缓存的最大条目数 ttl: 1000 * 60, // 缓存条目的存活时间(毫秒) }; const cache = new LRU(options)...
npm install --save memory-cache-nodeUsageCreating a memory cacheBelow example creates a memory cache for items which has string keys and number values. Memory cache checks expiring items every 600 seconds (i.e. every 10 minutes) The maximum number of items in the cache is 1 million....
npm install @mediaxpost/memory-cache Usage constMemoryCache=require('@mediaxpost/memory-cache');constclient=newMemoryCache({bypassUnsupported:true});client.createClient();client.set("TestKey",10);client.get("TestKey"); API Reference constructor(options) ...
dependabot/npm_and_yarn/grunt-include-replace-5.0.0 typescript-rewrite gh-pages v5.1.2 v5.1.1 v5.1.0 v5.0.2 v5.0.1 v5.0.0 v5.0.0-alpha.1 4.2.1 v4.2.1 4.2.0 4.1.1 4.1.0 4.0.0 3.2.1 3.2.0 3.1.0 3.0.1 3.0.0