Skip to content

Commit

Permalink
deno cache (denoland#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
ry authored Mar 20, 2024
1 parent 724b2e5 commit 93769e6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions runtime/manual/tools/cache.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# `deno cache`

**Purpose:** Pre-download and compile remote dependencies along with their
static imports, storing them in the local cache.

**Usage:**

- Cache a specific module and its dependencies without executing any code:
```
deno cache https://deno.land/std/http/file_server.ts
deno cache npm:express
```

**Behavior:**

- Modules cached using `deno cache` are stored in `$DENO_DIR`, a centralized
directory. Its location varies by OS. For instance, on macOS, it's typically
`/Users/ry/Library/Caches/deno`. You can see the location by running `deno info` with no arguments.
- Subsequent executions of cached modules don't require downloads or
compilation, unless `--reload` is used to force updates.

This ensures faster execution times for scripts that have already been cached,
by avoiding unnecessary network requests and recompilation.
1 change: 1 addition & 0 deletions runtime/manual/tools/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Deno features before they are finalized.

- [start new project (`deno init`)](./init.md)
- [benchmarker (`deno bench`)](./benchmarker.md)
- [`deno cache`](./cache.md)
- [compiling executables (`deno compile`)](./compiler.md)
- [installer (`deno install`)](./script_installer.md)
- [Jupyter kernel (`deno jupyter`)](./jupyter.md)
Expand Down

0 comments on commit 93769e6

Please sign in to comment.