How To Run JavaScript In VSCode

Ghost Together
2 min readAug 4, 2022

There are few different ways to run JavaScript in VSCode Terminal. And it depends on what you really want to do. In this tutorial I’ll drop a video and then for readers I’ll drop some basic instructions on running JS in VSCode.

(How to run js in vscode)

For some running JavaScript in VSCode means running the entire webapp in a browser. You can do this using extensions like LiveRunner.

But in many cases you just want to execute a single JavaScript file directly in the VSCode terminal. You can do that with NodeJS (make sure it’s installed.)

One way is to use the built-in NodeJS runtime. To do this, open your JavaScript file in VSCode and press F1 or Ctrl+Shift+P.

This will open the Command Palette.

Then type node and select the Run Node.js in Terminal command. Your JavaScript file will be executed in the vscode terminal.

Another way to run javascript files is to use the integrated task runner. To do this open your JavaScript file in VSCode and press Ctrl+Shift+B (or go to Debug

--

--

Ghost Together

Ghost Together @ https://semicolon.dev is an alternative to Twitter. Sign up to meet other makers of things.