Naphthalene Possum Management

    rgcache
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.4 • Public • Published

    rgcache

    Little caching module.

    Installing

    npm install rgcache
    yarn add rgcache

    Example

    let Cache = require('rgcache').Cache;
    let aCache = new Cache({
        ttl: 600, loader: async (key) => {
            console.log("loader call");
            return key.toLowerCase();
        }
    });
    
    (async () => {
        console.log(await aCache.get("BAN"));
        await aCache.get("BAN");
        aCache.delete("BAN");
        await aCache.get("BAN");
        aCache.set("LOL", "lols");
        console.log(await aCache.get("LOL"))
        aCache.clear();
        console.log(await aCache.get("LOL"))
        console.log(aCache.stats());
    })();```

    Keywords

    Install

    npm i rgcache

    DownloadsWeekly Downloads

    23

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    6.12 kB

    Total Files

    6

    Last publish

    Collaborators

    • redguys