This extension scans your workspace for package.json files, lists the available npm scripts in an Explorer view, and lets you run them with a single click.
If you have a monorepo or multi-root workspace with multiple package.json files, it groups scripts by the file they come from. If there’s only a single package.json, it shows just the scripts without an extra grouping node.
-
NPM Scripts view in Explorer
- Shows a dedicated
NPM Scriptstree in the Explorer sidebar. - Automatically scans the current workspace for
package.jsonfiles (ignoringnode_modules).
- Shows a dedicated
-
Grouping by
package.json- If your workspace has multiple
package.jsonfiles (e.g. monorepos, multi-root workspaces), each file appears as a parent node in the tree. - Child nodes under each package are the npm scripts defined in its
scriptssection. - Group nodes use a file icon and show the
package.jsonpath relative to the workspace folder for quick orientation. - If there is only a single
package.jsonwith scripts, the scripts are listed directly at the root of the view (no grouping node).
- If your workspace has multiple
-
One-click script execution
- Each script node shows a play button in the tree item row.
- Clicking the play button (or the script item itself) runs
npm run <script>in a VS Code terminal with the working directory set to thatpackage.json's folder. - Terminals are reused per package folder so repeated runs don’t clutter your workspace.
-
Manual refresh
- Use the refresh button in the
NPM Scriptsview title bar to re-scan the workspace after changingpackage.jsonfiles.
- Use the refresh button in the
You need:
- A workspace folder containing one or more
package.jsonfiles. npmavailable on your systemPATHso thatnpm runcommands can execute in the integrated terminal.
This extension does not currently contribute any user-facing settings.