JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1239
  • Score
    100M100P100Q107958F
  • License MIT

Simple in-memory cache implementation

Package Exports

  • fast-memory-cache

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fast-memory-cache) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

fast-memory-cache

NodeJs fast memory cache implementation.

Installation

npm install fast-memory-cache --save

Usage example

var MemoryCache = require('fast-memory-cache');

var cache = new MemoryCache();

var val = cache.get('key'); // undefined

cache.set('key', 'value', 1000);

val = cache.get('key'); // 'value'

cache.delete('key');

val = cache.get('key'); // undefined

cache.set('key', 'new-value', 1000);

setTimeout(function() {

    val = cache.get('key'); // undefined

}, 2000);