🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@d1testflare/cache

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

@d1testflare/cache

Cache module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers

latest
Source
npmnpm
Version
2.9.0
Version published
Maintainers
1
Created
Source

@d1testflare/cache

Cache module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers. See ✨ Cache for more details.

Example

import { Cache } from "@d1testflare/cache";
import { Response } from "@d1testflare/core";
import { MemoryStorage } from "@d1testflare/storage-memory";

const cache = new Cache(new MemoryStorage());

const key = "http://localhost";
const res = new Response("body", {
  headers: { "Cache-Control": "max-age=3600" },
});
await cache.put(key, res);

const cachedRes = await cache.match(key);
console.log(await cachedRes.text()); // body

Keywords

cloudflare

FAQs

Package last updated on 04 Oct 2022

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