Socket
Socket
Sign inDemoInstall

simple-localstorage-cache

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-localstorage-cache

A simple local-storage cache with time based expiration policies


Version published
Weekly downloads
20
Maintainers
1
Weekly downloads
 
Created
Source

simple-localstorage-cache

A simple local-storage cache with time based expiration policies

features

  • simplicity: get, set, and keys with an intuitive, pit-of-success, implementation
  • interoperability: fulfills the standard SimpleAsyncCache interface
  • garbage collection: automatically removes expired keys from local-storage to free up space

install

npm install simple-localstorage-cache

use

create a cache

const cache = createCache({ namespace: 'super-awesome-feature' });

set to the cache

await cache.set('answer', 42);

ℹ️ note: if you'd like an item to never expire, set the expiration time to null or Infinity

get from the cache

await cache.get('answer'); // 42

Keywords

FAQs

Package last updated on 16 Jul 2023

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