1.1.2 • Published 5 years ago

promised-cache v1.1.2

Weekly downloads
8
License
GPL-3.0
Repository
github
Last release
5 years ago

Build Status

promised-cache

A cache meant for Node.js that stores in memory and to disk with a timeout. Each method returns a promise. Keys can be any type string/number/array/object as their hashes will be used internally.

Install

$ npm install promised-cache --save

Example use

const Cache = require('promised-cache');

const cache = new Cache('cahename', 3600 * 1000);

cache.set('a key', {some: {data: 'to store'}});

cache.get('a key').then((cachedData) => {
  console.log(cachedData); // Prints {some: {data: 'to store'}}
});