Skip to main content

A temporary superfast in-memory key-value store with automatic invalidation.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
4 months ago (0.1.0)
class TempDB

Constructors

new
TempDB(
lifeTime: number,
invalidationTime?: number,
)

Creates an instance of TempDB.

Properties

map: Map<string, { data: any; time: number; }>

Methods

get(key: string): { data: any; time: number; } | undefined

Retrieves a value from the TempDB by key.

set(
key: string,
value: any,
): void

Sets a key-value pair in the TempDB with the current timestamp.

Add Package

deno add jsr:@riasat/tempdb

Import symbol

import module from "@riasat/tempdb";

---- OR ----

Import directly with a jsr specifier

import module from "jsr:@riasat/tempdb";

Add Package

npx jsr add @riasat/tempdb

Import symbol

import module from "@riasat/tempdb";

Add Package

yarn dlx jsr add @riasat/tempdb

Import symbol

import module from "@riasat/tempdb";

Add Package

pnpm dlx jsr add @riasat/tempdb

Import symbol

import module from "@riasat/tempdb";

Add Package

bunx jsr add @riasat/tempdb

Import symbol

import module from "@riasat/tempdb";