Skip to main content

Built and signed on GitHub Actions

Deno CLI's module cache.

This package works with Deno
This package works with Deno
JSR Score
82%
Published
2 months ago (0.18.0)

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.

A module which provides a TypeScript implementation of the Deno CLI's cache directory logic (DENO_DIR). This can be used in combination with other modules to provide user loadable APIs that are like the Deno CLI's functionality.

This also can provide user read access in Deploy to a Deno CLI's cache when the cache is checked into the repository.

Example

import { createCache } from "@deno/cache-dir";
import { createGraph } from "@deno/graph";

// create a cache where the location will be determined environmentally
const cache = createCache();
// destructuring the two functions we need to pass to the graph
const { cacheInfo, load } = cache;
// create a graph that will use the cache above to load and cache dependencies
const graph = await createGraph("https://deno.land/x/oak@v9.0.1/mod.ts", {
  cacheInfo,
  load,
});

// log out the console a similar output to `deno info` on the command line.
console.log(graph.toString());
Built and signed on
GitHub Actions
View transparency log

Add Package

deno add jsr:@deno/cache-dir

Import symbol

import * as cache_dir from "@deno/cache-dir";

---- OR ----

Import directly with a jsr specifier

import * as cache_dir from "jsr:@deno/cache-dir";