Open
Description
Description
It's annoying to have to use multiple tools to switch between different JavaScript runtimes/engines. As there is more & more interoperability (& work to standardize APIs across these projects) developers switching between &/or using multiple engines will become the norm. Providing an end-to-end toolchain experience eliminates the need for independent runtime management tools (ex. fnm
, nvm
, n
, nave
, asdf
, volta
etc.).
Proposal
- implement a new
use
command use
will install the defined runtime/engine intonode_modules/
& have it's bins available viarun
/exec
(globally?)engines
gains support fordevDependency
references (similar tonpm
'sdependency
references inoverrides
)engines
references are resolved prior to any validating/usageengines
definitions can be overidden bypublishConfig.engines
duringpack
/publish
(making it possible to delineate dev vs. dist-specificengines
)- setting
--publish
will updatepublishConfig.engines
instead ofengines
- support known tags/release channels beyond configured registry dist-tags (ex.
node@lts
~ https://www.npmjs.com/package/@pkgjs/nv)
Key differences between install
- intended to manage
devDependencies
&engines
specifically - specs are respected & saved as defined
Known engines
definitions/locations
engines
can contain any number of definitions but there is a subset of "known" runtimes & their corresponding releases/versions we can support/manage- ex. all major runtimes have corresponding packages that can be downloaded via
npm
today:- node:
npm:node@*
https://npmjs.com/node - deno:
npm:deno-bin@*
https://www.npmjs.com/package/deno-bin - bun:
npm:bun@*
(official) https://www.npmjs.com/package/bun - npm:
npm:npm@*
(official) https://www.npmjs.com/package/npm - yarn:
npm:yarn@<2 || npm:@yarnpkg/cli-dit@>2
(official) https://www.npmjs.com/package/yarn - pnpm:
npm:pnpm@*
(official) https://www.npmjs.com/package/pnpm
- node:
- somewhat more official, consistent, runtime release channel destinations are:
Example Usage
$ vlt use npm@latest
$ vlt use node@lts
$ vlt use node@>=20 --publish
{
"devDependencies": {
"npm": "npm:npm@latest",
"node": "npm:node@lts"
},
"engines": {
"npm": "$npm",
"node": "$node"
},
"publishConfig": {
"engines": {
"node": "npm:node@>=20"
}
}
}
Activity