🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more
Socket
Book a DemoInstallSign in
Socket

@joshdb/cache

Package Overview
Dependencies
Maintainers
1
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@joshdb/cache

A cache middleware for Josh

Source
npmnpm
Version
2.0.0-next.da3e58d.0
Version published
Weekly downloads
2
-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

Josh Logo

@joshdb/cache

An auto ensure middleware for Josh.

GitHub codecov npm bundle size npm

Support Server

Description

A cache middleware for Josh.

Features

  • Written in TypeScript
  • Offers CommonJS, ESM and UMD bundles
  • Fully tested

Installation

You can use the following command to install this package, or replace npm install with your package manager of choice.

npm install @joshdb/cache

Middleware Context Data

interface ContextData<StoredValue = unknown> {
  /**
   * The JoshProvider to use for cache
   * @since 1.0.0
   */
  provider: JoshProvider<Document<StoredValue>>;

  /**
   * When true, fetches all entries from the provider on startup
   * @since 1.0.0
   * @default true
   */
  fetchAll: boolean;

  /**
   * When enabled fetches from the cache provider on a set interval
   * @since 1.0.0
   */
  polling?: PollingOptions;

  /**
   * When enabled invalidates entries from the cache provider when they expire
   * @since 1.0.0
   */
  ttl?: TTLOptions;
}

FAQs

Package last updated on 08 Dec 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