Quickly execute npm run and switch node versions through the command panel.
- Support detection of npm scripts in subdirectory
- Automatically switch node versions according to the
.nvmrcfile in the same directory - Setting default node version
Quickly execute npm install, npm ci, pnpm install, yarn install commands.
-
npm run (Last Used Terminal): Displays all availablenpm runscripts and executes them in the last used terminal. -
npm run (New Terminal): Displays all availablenpm runscripts and executes them in the new terminal. -
npm install: Displays all availablenpm install,npm ci,pnpm install,yarn installcommands and executes them in the last used terminal.
-
Default Node Version: Set the default node version. When there is no.nvmrcfile andpackage.json'sengines.nodefield does not specify the node version, the default node version will be used. -
Single Line Command: Single line command mode. Merge the operations of switching directories, switching node versions, and executing npm scripts into a single line command. Recommended for Windows users to choose a non-cmd terminal byTerminal: Select Default Profileand set this option toalways use;.
In addition to configuring the default node version in the extension settings, you can also add .nvmrc file or engines.node field in package.json to specify the node version.
The priority of node version is as follows:
.nvmrcfile;engines.nodefield inpackage.json:- Node version without any symbol at the beginning, like
20.11.0; - Node version with
^symbol at the beginning, like^20.11.0; - Node version with
~symbol at the beginning, like~20.11.0; - Node version with
>=or<=symbol at the beginning, will take the highest version number, like>=20.11.0 <=21.10.0will take21.10.0; - NOTE: the node version start with
<or>will be ignored now(maybe will support in the future).
- Node version without any symbol at the beginning, like
- Default node version in the extension settings.
engines.node example:
{
"engines": {
"node": "20.11.0 ^22.12.0 ~18.20.4 <=16.0.0 >=23.0.0 <20.0.0 >21.0.0"
}
}The Node 20.11.0 version will be used, and the <20.0.0 and >21.0.0 will be ignored.
The npm run XXX and npm install commands will be merged into a single line command according to the Single Line Command setting.
If Single Line Command is set to always use ;, the command will like this:
cd d:\Projects\vscode-extension\vscode-powerful-npm-run\test\;nvm use 20.11.0;npm run test- Configure default node version
- Support
npm install,pnpm install,yarn installand other related commands - Run all commands in one line
- Get node version from
package.json'senginesfield - Remember the last command you used for each workspace directory
- Support execution of npm scripts through tasks
- Internationalization
MIT

