Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Execute ScriptNew to Visual Studio Code? Get it now.
Execute Script

Execute Script

Appitone

|
4,864 installs
| (0) | Free
It can execute any script (including inside node.js via `node` command)
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

README appitone.runscript

It can execute any script (including inside node.js via node command)

Features

It can execute any script (including inside node.js via node command), this extension support ${workspaceFolder}, ${file}, ${npmGlobalNodemodules} and ${localDevFolder} replacers

rules for ${localDevFolder}

  • load value from Environment variable LOCAL_DEV_FOLDER
  • if Environment variable not found default path is:
    • Windows: C:\Users\<username>\work
    • Linux: /home/<username>/work
    • Mac OS: /Users/<username>/work

Everything is executed

  • on Windows in Git Bash
  • on Linux in built-in Bash shell

Here is example of launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch TS current",
            "console": "integratedTerminal",
            "program": "${input:iSetCurrentDebugPath}",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "preLaunchTask": "tsc-built",
            "resolveSourceMapLocations": [
                "${workspaceFolder}/**"
            ]
        }
    ],
    "inputs": [
        {
            "id": "iSetCurrentDebugPath",
            "type": "command",
            "command": "appitone.runscript.execute",
            "args": {
                "strScript": "node",
                // all parameters below are OPTIONAL (with default value false or undefined based on datatype)
                "aStrArgs": [
					"${workspaceFolder}/script/desired_script.js",
					"${file}"
				],
                "strCwd": "${workspaceFolder}",
                "bolAddApostrophy": false,
                "bolConvertToForwardslash": false,
                "bolShowOutput": false,
                // Applies only for multi workspace environments (if not defined and VS code is in multi workspace environment first workspace will be used)
                "strFilterWorkspaceByFolderName": "nodejs",
                // If `true` NPM Global nodemodules will be resolved via `npm root -g` command
                "bolNpmGlobalNodemodulesUseResolve": false
            }
        }
    ]
}

Requirements

on Windows

  • 64-bit Git for Windows Setup must be installed in default path C:\Program Files\Git\bin\bash.exe

Extension Settings

For example:

This extension contributes the following settings:

  • appitone.runscript.execute: executes any desired script.
  • appitone.runscript.npmGlobalNodemodules: returns NPM Global OS default node_modules path.
  • appitone.runscript.npmGlobalNodemodulesResolved: returns NPM Global node_modules path resolved via command npm root -g.
  • appitone.runscript.localDevFolder: returns current localDevFolder path.

Known Issues

Release Notes

0.1.6

Initial release of this extension


Enjoy!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft