Socket
Socket
Sign inDemoInstall

@wry/caches

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wry/caches

Various cache implementations


Version published
Maintainers
1
Created

What is @wry/caches?

The @wry/caches package provides a simple and efficient caching mechanism designed to store and retrieve values based on keys. It is particularly useful for optimizing performance by reducing the need to recompute or fetch data that has been previously processed or retrieved.

What are @wry/caches's main functionalities?

Simple Key-Value Cache

This feature allows you to create a simple cache where you can store and retrieve values using keys. The example demonstrates setting a value with a key and then retrieving it.

{"const {Cache} = require('@wry/caches'); const cache = new Cache(); cache.set('key', 'value'); console.log(cache.get('key')); // Outputs: 'value'"}

Cache Entry Expiration

This feature supports setting an expiration time for cache entries. The example shows how to set a cache entry that expires after 3000 milliseconds.

{"const {Cache} = require('@wry/caches'); const cache = new Cache(); cache.set('key', 'value', {maxAge: 3000}); setTimeout(() => { console.log(cache.get('key')); // Outputs: undefined }, 3100);"}

Other packages similar to @wry/caches

FAQs

Package last updated on 28 Nov 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