ILoveReactAndNode
ILoveReactAndNode

Reputation: 311

how to show the latest changes in my console.log in node.js

This question might be very primitive but I just started learning node stuff so please bear with me. I have many console.log in my code and when I use React I just refresh the page to see the latest changes in the logs. But now that i am learning node, refreshing the browser doesn't do that and I have to close and re-run node index.js in my command line. So what is the way of seeing my console.log lates changes? By the way, I'm using VSC as editor.

Upvotes: 0

Views: 111

Answers (1)

Sello Mkantjwa
Sello Mkantjwa

Reputation: 1915

Yes. you should restart your node server (index.js). You can use nodemon to do this for you automatically when you save a file. So instead of node index.js, you can just run nodemon index

Upvotes: 1

Related Questions