Node.js and VScode

New task for this week,  we need to learn node.js and get used to VScode.

Here is my easy start up exercise.

In the node command prompt”black box”, we can execute as JavaScript environment.

Input “node”, the cursor will change to “>”, now it is JavaScript console.

Cap1

Input ctrl + C , JavaScript console will exit.

As a lazy coder, here is a lazy way to create file and edit it by VScode.

lazy⇒⇒lazy2

 

“echo” is to create file ‘lazy.js’, code is to open this file by VS code.

You also can use code lazy.js directly, because this command includes creating file.

In my lazy.js, i just input a simple for loop as example,

Usually, we have to use browser to execute it. But in Node, we can use command “node <filename>” to execute by terminal.

Next, just give some quick keys of VS code,

ctrl + ö  to open terminal

ctrl+shif+p to open command palette

 

Leave a comment