Skip to content

Commit 5872b12

Browse files
committed
docs: document devEngines.runtime
1 parent 5d7f37a commit 5872b12

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

docs/package_json.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,53 @@ installed as a dependency.
3434

3535
[settings]: ./settings.md#engineStrict
3636

37+
## devEngines.runtime
38+
39+
Added in: v10.14
40+
41+
Allows to specify one or more JavaScript runtime engines used by the project. Supported runtimes are Node.js, Deno, and Bun.
42+
43+
For instance, here is how to add `node@^24.4.0` to your dependencies:
44+
45+
```json
46+
{
47+
"devEngines": {
48+
"runtime": {
49+
"name": "node",
50+
"version": "^24.4.0",
51+
"onFail": "download"
52+
}
53+
}
54+
}
55+
```
56+
57+
You can also add multiple runtimes to the same `package.json`:
58+
59+
```json
60+
{
61+
"devEngines": {
62+
"runtime": [
63+
{
64+
"name": "node",
65+
"version": "^24.4.0",
66+
"onFail": "download"
67+
},
68+
{
69+
"name": "deno",
70+
"version": "^2.4.3",
71+
"onFail": "download"
72+
}
73+
]
74+
}
75+
}
76+
```
77+
78+
How it works:
79+
80+
1. `pnpm install` resolves your specified range to the latest matching runtime version.
81+
1. The exact version (and checksum) is saved in the lockfile.
82+
1. Scripts use the local runtime, ensuring consistency across environments.
83+
3784
## dependenciesMeta
3885

3986
Additional meta information used for dependencies declared inside `dependencies`, `optionalDependencies`, and `devDependencies`.

0 commit comments

Comments
 (0)