Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

kath

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kath

Another in-memory caching

  • 0.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

kath

Another in-memory caching

Under Construction.

Installation

$ yarn add kath

Usage

const { createCache } = require('kath');

const cache = createCache(10);

cache.put('key', 'value');

console.log(cache.get('key'));

// key

API

createCache(capacity: number, cache?: Map<any, Entry>): LRUCache

  • capacity - The capacity of the cache.
  • cache - Create with a existing cache.

LRUCache

class LRUCache extends DDL {
    private _capacity;
    private _cache;
    constructor(capacity: number, cache?: Map<any, Entry>);
    get(key: any): any;
    put(key: any, value: any): void;
    data(): Map<any, Entry>;
    private moveToHead;
}

toCacheMap(cacheStr: string): Map<any, Entry>

Parse JSON string to Map<string, Entry>.

toJSON(cacheMap: Map<any, Entry>): string

Stringify cache map to JSON string.

License

MIT

Keywords

FAQs

Package last updated on 24 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc