@serayaeryn/memory-cache

simple memory cache

Usage no npm install needed!

<script type="module">
  import serayaerynMemoryCache from 'https://cdn.skypack.dev/@serayaeryn/memory-cache';
</script>

README

memory-cache

Build Status Coverage Status NPM version JavaScript Style Guide

Installation

npm i @serayaeryn/memory-cache

API

Cache(options)

ttl

Time to live in milliseconds.

Cache#get(key)

Returns the cached entry for the key.

Cache#has(key)

Allows to check if the cache contains an entry for the key.

Cache#remove(key)

Remove the entry for the key from the cache.

Cache#put(key, value)

Stores the value for the key in the cache.

License

Licensed under MIT.