Socket
Book a DemoInstallSign in
Socket

flash-cache

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flash-cache

Saving temporary data in memory, and clear the old data at regular time.

0.4.0
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

Flash Cache

Saving temporary data in memory, and clear the old data at regular time.

build status Test coverage David deps node version

NPM

Be inspired by the GC algorithm of JVM and V8. I use two area to store data , the old area and the young area. After initializing the class of FlashCache with a given interval value, the instance of FlashCache's object will move the young area's data to old area, and then create a new young area. It's suit for saving temporary data in memory to improve you app's performance.

Install

npm install flash-cache

API

See the api doc.

Demo

const FlashCache = require('flash-cache');
const cache = new FlashCache();//The default interval of moving young to old is 1000ms.
cache.save('a','the value');
console.log(cache.get('a'));
setTimeout(function() {
    console.log('young size',cache.young.size);//should get 0
},1000+100);

License

MIT

Keywords

cache

FAQs

Package last updated on 23 May 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.