New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@luolapeikko/cache-types

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@luolapeikko/cache-types

Typescript cache interfaces

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@luolapeikko/cache-types

Typescript Cache interfaces.

Cache interface is a simple Map like key-value interface with basic operations like get, set, has, delete and clear with cache related options like "set" method to add entry ttl to the cache and "expires" method to get current entry ttl.

Example

import {type ICache} from '@luolapeikko/cache-types';

function foo(cache: ICache<string>) {
	const value = cache.get('key');
	cache.set('key', 'value' /*, ttl: Date */);
	cache.has('key'); // true
	cache.expires('key'); // Date or undefined
	cache.delete('key');
	cache.clear();
	cache.size(); // 0
}

Full Documentation

Keywords

FAQs

Package last updated on 05 Sep 2024

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