aboutsummaryrefslogtreecommitdiff
path: root/docs/guides/install/yarnlock.md
blob: a9e8c852144fe4d3f6797820b9619f26e062015b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
name: Generate a human-readable lockfile
---

By default Bun generates a binary `bun.lockb` file when you run `bun install`. In some cases, it's preferable to generate a human-readable lockfile instead.

---

Use the `--yarn` flag to generate a Yarn-compatible `yarn.lock` file (in addition to `bun.lockb`).

```sh
$ bun install --yarn
```

---

To set this as the default behavior, add the following to your `bunfig.toml` file.

```toml#bunfig.toml
[install.lockfile]
print = "yarn"
```

---

To print a Yarn lockfile to your console without writing it to disk, just "run" your `bun.lockb` with `bun`.

```sh
$ bun bun.lockb
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
# bun ./bun.lockb --hash: 9BFBF11D86084AAB-9418b03ff880c569-390CE6459EACEC9A...

abab@^2.0.6:
  version "2.0.6"
  resolved "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz"
  integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvH...
```

---

See [Docs > Package manager](/docs/cli/install) for complete documentation of Bun's package manager.