In node -supervisor, how can I view everything in the directory for changes?

https://github.com/isaacs/node-supervisor

I want to see everything inside the "api" directory and all its subdirectories (recursively). How can i do this?

sudo supervisor -w app.js,api app.js 

This does not work. It looks only at the api directory, not its subdirectories.

+4
source share
2 answers

It seems that we are working and detecting changes for me.

If I use this to upload a file:

 var module = require("./folder/test/variables.js") 

And have the main file node:

 var module = require("./folder/test/variables.js") var http = require('http'); http.createServer(function (request, response) { response.writeHead(200, {'Content-Type': 'text/plain'}); response.end('The variable is '+ module.variable) }).listen(7777); 

Then, just using:

 supervisor myApp.js 

will detect changes in the / test / variables folder, which is a subfolder.

Actually, the manager says that he controls the current folder:

 DEBUG: Running node-supervisor with DEBUG: program 'myApp.js' DEBUG: --watch '.' DEBUG: --extensions 'node|js' DEBUG: --exec 'node' 

It also reloads the files in the folder / test if I use:

 supervisor -w folder myApp.js 

So, I think you might have a different version of the supervisor? I am using 0.2

+3
source

I am just looking through all the extensions I use:

 supervisor -e 'js|ejs|less' app.js 
+7
source

Source: https://habr.com/ru/post/1382622/


All Articles