@zcorky/cache
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Cache Build Status

A simple cache lib

Install

$ npm install @zcorky/cache

Usage

const Cache = require('@zcorky/cache').Cache;
// import Cache from '@zcorky/cache'; // ts or es6

// create cache instance
const cache = new Cache(2);
// const cache = Cache.create(2);

// set key, value
cache.set(key, value);

// get key
cache.get(key);

// value2
cache.set(key2, value2);
// get key
cache.get(key2);

// cache size
cache.size();

// cache is empty
cache.empty();

// cache is full
cache.full();

// cache has key
cache.hasKey(key);

// cache remove key
cache.remove(key);

// cache clear
cache.clear(key);

// cache hits
cache.hits();

License

MIT © Moeover

Dependents (0)

Package Sidebar

Install

npm i @zcorky/cache

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

6.34 kB

Total Files

5

Last publish

Collaborators

  • uniquecolesmith