Skip to content

Commit 18a4590

Browse files
AttackThwarterManagorznarfm
authored
bun-{install, i, run, test}: add pages (#19129)
Co-authored-by: Managor <[email protected]> Co-authored-by: Meinard Francisco <[email protected]>
1 parent 10c0805 commit 18a4590

File tree

4 files changed

+76
-0
lines changed

4 files changed

+76
-0
lines changed

pages/common/bun-i.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# bun i
2+
3+
> This command is an alias of `bun install`.
4+
5+
- View documentation for the original command:
6+
7+
`tldr bun install`

pages/common/bun-install.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# bun install
2+
3+
> Install JavaScript dependencies for a project from `package.json`.
4+
> More information: <https://bun.com/docs/cli/install>.
5+
6+
- Install all dependencies listed in `package.json`:
7+
8+
`bun {{[i|install]}}`
9+
10+
- Install a single package (this is an alias for `bun add`):
11+
12+
`bun {{[i|install]}} {{package_name}}@{{version}}`
13+
14+
- Install a package globally:
15+
16+
`bun {{[i|install]}} {{[-g|--global]}} {{package_name}}`
17+
18+
- Install only production dependencies (skips `devDependencies`):
19+
20+
`bun {{[i|install]}} --production`
21+
22+
- Install dependencies exactly from the `bun.lockb` lockfile (frozen lockfile):
23+
24+
`bun {{[i|install]}} --frozen-lockfile`
25+
26+
- Force re-download all packages from the registry, ignoring the cache:
27+
28+
`bun {{[i|install]}} {{[-f|--force]}}`

pages/common/bun-run.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# bun run
2+
3+
> Execute a JavaScript/TypeScript file, or a script from `package.json`.
4+
> More information: <https://bun.com/docs/cli/run>.
5+
6+
- Run a script defined in `package.json`:
7+
8+
`bun run {{script_name}}`
9+
10+
- Run a JavaScript or TypeScript file directly:
11+
12+
`bun run {{path/to/file.ts}}`
13+
14+
- Run a file in "watch" mode (restarts automatically when the file changes):
15+
16+
`bun run --watch {{path/to/file.ts}}`
17+
18+
- Run a file using a specific configuration file:
19+
20+
`bun run --config {{path/to/bunfig.toml}} {{path/to/file.ts}}`

pages/common/bun-test.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# bun test
2+
3+
> Run tests using Bun's built-in test runner.
4+
> It is a fast, Jest-compatible test runner that looks for `*.test.ts` (and similar) files.
5+
> More information: <https://bun.com/docs/cli/test>.
6+
7+
- Run all test files found in the project:
8+
9+
`bun test`
10+
11+
- Run a specific test file or directory:
12+
13+
`bun test {{path/to/file.test.ts}}`
14+
15+
- Run tests in "watch" mode (re-runs automatically on file changes):
16+
17+
`bun test --watch`
18+
19+
- Run tests and generate a code coverage report:
20+
21+
`bun test --coverage`

0 commit comments

Comments
 (0)