simple-node-cache
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

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

Package Sidebar

Install

npm i simple-node-cache

Weekly Downloads

13

Version

1.0.9

License

MIT

Unpacked Size

4.63 kB

Total Files

6

Last publish

Collaborators

  • changwoolab