JSPM

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

simple in-memory cache for node.js

Package Exports

  • simple-node-cache
  • simple-node-cache/index.js

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 (simple-node-cache) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

simple-node-cache

A simple in-memory cache for node.js

There are no type limitations. You can cache almost everything.

Installation

npm i simple-node-cache

How to use?

import { CacheManager } from 'simple-node-cache';

const cache = new CacheManager();

cache.set('key', 'value');
console.log(cache.get('key'));

Supports

set

Stores value with given key

Caution: This overrides existing value

del

Deletes value with given key

expire

Set Time To Live in seconds

get

Get value by given key

Returns undefined if there is no key

clear

Deletes all keys

size

Get current number of entries

keys

Get all cache keys