Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clarity to documentation for deno install and deno uninstall CLI subcommands #1016

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions runtime/reference/cli/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,32 @@ command: install

### deno install

Use this command to install all dependencies defined in `deno.json` and/or
Use this command with no particular pacakges specified to install all dependencies
defined in the `imports` field of `deno.json` and/or the `dependencies` field of
`package.json`.

The dependencies will be installed in the global cache, but if your project has
a `package.json` file, a local `node_modules` directory will be set up as well.

### deno install [PACKAGES]

Use this command to install particular packages and add them to `deno.json` or
`package.json`.
Use this command with particular packages specified to add them to `imports` in
`deno.json` or `dependencies` in `package.json`, and then immediately install them.

```shell
$ deno install jsr:@std/testing npm:express
```

:::tip

You can also use `deno add` which is an alias to `deno install [PACKAGES]`
The [`deno add`](/runtime/reference/cli/add/) command will add packages to `imports`
in `deno.json`, without installing the packages.

:::

If your project has a `package.json` file, the packages coming from npm will be
added to `dependencies` in `package.json`. Otherwise all packages will be added
to `deno.json`.
to `imports` in `deno.json`.

### deno install --entrypoint [FILES]

Expand Down
12 changes: 3 additions & 9 deletions runtime/reference/cli/uninstall.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ command: uninstall

## `deno uninstall [PACKAGES]`

Remove dependencies specified in `deno.json` or `package.json`:
Remove dependencies specified in `deno.json` or `package.json` and uninstall them:

```shell
$ deno add npm:express
Expand All @@ -32,7 +32,8 @@ $ cat deno.json

:::tip

You can also use `deno remove` which is an alias to `deno uninstall [PACKAGES]`
The [`deno remove`](/runtime/reference/cli/remove/) command will remove packages
from the configuration file, without uninstalling the packages.

:::

Expand Down Expand Up @@ -63,13 +64,6 @@ $ cat deno.json
}
```

:::info

While dependencies are removed from the `deno.json` and `package.json` they
still persist in the global cache for future use.

:::

If your project contains `package.json`, `deno uninstall` can work with it too:

```shell
Expand Down
Loading