Natesh bhat
Natesh bhat

Reputation: 13247

How to list all the installed scripts in deno?

I had installed some scripts in deno before.

How do I list all the installed scripts in deno ?

Is there any deno subcommand to do this ?

Upvotes: 3

Views: 926

Answers (1)

Marcos Casagrande
Marcos Casagrande

Reputation: 40444

All downloaded scripts are stored in

$DENO_DIR/deps

$DENO_DIR varies depending on the OS

  • On Linux/Redox: $XDG_CACHE_HOME/deno or $HOME/.cache/deno
  • On Windows: %LOCALAPPDATA%/deno (%LOCALAPPDATA% = FOLDERID_LocalAppData)
  • On macOS: $HOME/Library/Caches/deno If something fails, it falls back to $HOME/.deno

You can check the location doing:

deno info

Which will output:

DENO_DIR location: "/home/user/.cache/deno"
Remote modules cache: "/home/user/.cache/deno/deps"
TypeScript compiler cache: "/home/user/.cache/deno/gen"

The file is stored with a hashed name, so if you want to see the URL you'll need to access {file}.metadata.json and check url property.

You can use the following command to list all:

# Change /home/user/.cache/deno/deps with your location
find /home/user/.cache/deno/deps -name *.metadata.json | xargs jq ".url"
"https://deno.land/[email protected]/path/_util.ts"
"https://deno.land/std/path/mod.ts"
"https://deno.land/[email protected]/http/_io.ts"
"https://deno.land/[email protected]/fmt/colors.ts"
"https://deno.land/std/fmt/colors.ts"
"https://deno.land/[email protected]/http/server.ts"
"https://deno.land/std/async/mux_async_iterator.ts"
"https://deno.land/std/testing/diff.ts"

Upvotes: 2

Related Questions