mr_blond
mr_blond

Reputation: 1730

Is there a way to watch file changes in main js file runned in nodejs?

There is a main.js javascript file with programm.

I run it:

node --inspect-brk index.js

Every time when I change something in this file I have to rerun it.

I need some way to let nodejs know that this main.js file was changed and make nodejs rerun it.

Is there a way to watch file changes in main js file runned in nodejs?

Upvotes: 0

Views: 1214

Answers (1)

Sarthak Jain
Sarthak Jain

Reputation: 2096

You can use nodemon. It will detect any changes to your directory and rerun the app.

npm install --save-dev nodemon
nodemon --inspect-brk index.js

Upvotes: 1

Related Questions