Skip to main content
Home

@murat/yelix@0.1.47
Built and signed on GitHub Actions

Yelix is a powerful web server library built specifically for Deno, leveraging the Hono framework in the background. Including built-in data validation, OpenAPI 3.1 support, and auto-generated backend documentation.

This package works with Deno
This package works with Deno
JSR Score
82%
Published
2 months ago (0.1.47)
class YelixCache

A generic in-memory cache implementation with TTL support

Constructors

new
YelixCache()

Creates a new instance of YelixCache

Type Parameters

The type of values to be stored in the cache

Properties

private
cache: Map<string, CacheItem<T>>

Internal storage for cached items

Methods

cleanup(_ctx: Ctx | null): void

Removes all expired items from the cache

clear(_ctx: Ctx | null): void

Removes all items from the cache

delete(
_ctx: Ctx | null,
key: string,
): boolean

Removes an item from the cache

get(
ctx: Ctx | null,
key: string,
): T | undefined

Retrieves a value from the cache

has(
ctx: Ctx | null,
key: string,
): boolean

Checks if a key exists in the cache and is not expired

set(
ctx: Ctx | null,
key: string,
value: T,
ttl?: TTLValue,
): void

Stores a value in the cache with an optional expiration time

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@murat/yelix

Import symbol

import { YelixCache } from "@murat/yelix";
or

Import directly with a jsr specifier

import { YelixCache } from "jsr:@murat/yelix";