Skip to content

Commit

Permalink
Docs for bun update --latest
Browse files Browse the repository at this point in the history
  • Loading branch information
Electroid committed Jun 1, 2024
1 parent e3b7635 commit 3a63f46
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions docs/cli/update.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
To update all dependencies to the latest version _that's compatible with the version range specified in your `package.json`_:
To update all dependencies to the latest version:

```sh
$ bun update
```

## `--force`
To update a specific dependency to the latest version:

{% callout %}
**Alias**`-f`
{% /callout %}
```sh
$ bun update [package]
```

## `--latest`

By default, `bun update` will update to the latest version of a dependency that satisfies the version range specified in your `package.json`.

By default, Bun respects the version range defined in your package.json. To ignore this and update to the latest version, you can pass in the `force` flag.
To update to the latest version, regardless of if it's compatible with the current version range, use the `--latest` flag:

```sh
$ bun update --force
$ bun update --latest
```

For example, with the following `package.json`:

```json
{
"dependencies": {
"react": "^17.0.2"
}
}
```

- `bun update` would update to a version that matches `17.x`.
- `bun update --latest` would update to a version that matches `18.x` or later.

0 comments on commit 3a63f46

Please sign in to comment.