nkrowicki
nkrowicki

Reputation: 11

Vscode Shortcut for run script on terminal?

There is a way that allows me that when I am editing a js file I can through a shortcut: open the terminal and run it automatically:

1- Open terminal 2- node my-file.js

Right now it only manages to open terminal with shortcut "ctrl + ´" but then I have to type "node my-file.js"

Upvotes: 1

Views: 8062

Answers (1)

Hosseinreza
Hosseinreza

Reputation: 551

There is easy way to run JavaScript, no configuration needed:

  1. Install the Code Runner Extension
  2. Open the JavaScript code file in vscode, then use shortcut Control+Alt+N (or ⌃ Control+ Option+N on macOS), or press F1 and then select/type Run Code, the code will run and the output will be shown in the Output Window.

Upvotes: 1

Related Questions