Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.
/ es6-cachemanager Public archive

[Deprecated] A basic cache manager implementation

License

Notifications You must be signed in to change notification settings

eser/es6-cachemanager

Repository files navigation

npm version npm download dependencies license

What is the ES6-CacheManager?

ES6-CacheManager is a basic cache manager implementation.

Quick start

Execute npm install es6-cachemanager to install es6-cachemanager and its dependencies into your project directory.

Usage

To cache a function result:

import { cacheManager } from 'es6-cachemanager';

const dateFunc = () => cacheManager.get('cachedDate', () => new Date());

console.log(await dateFunc());
console.log(await dateFunc());

Alternatively, to decorate a function with caching layer:

import { cacheManager } from 'es6-cachemanager';

@cacheManager.cached('cachedDateFunc', 200)
function dateFunc() {
    return new Date();
}

console.log(await dateFunc());
console.log(await dateFunc());

Todo List

See GitHub Projects for more.

Requirements

License

Apache 2.0, for further details, please see LICENSE file

Contributing

See contributors.md

It is publicly open for any contribution. Bugfixes, new features and extra modules are welcome.

  • To contribute to code: Fork the repo, push your changes to your fork, and submit a pull request.
  • To report a bug: If something does not work, please report it using GitHub Issues.

To Support

Visit my patreon profile at patreon.com/eserozvataf

About

[Deprecated] A basic cache manager implementation

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published