簡體   English   中英

在node-supervisor中,如何查看目錄中的所有內容以進行更改?

[英]In node-supervisor, how do I watch everything in a directory for changes?

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

我想在“api”目錄及其所有子目錄(遞歸)中查看所有內容。 我怎樣才能做到這一點?

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

這似乎不起作用。 它只觀看“api”目錄,而不是它的子目錄。

我只是看着我正在使用的所有擴展:

supervisor -e 'js|ejs|less' app.js

似乎工作並檢測我的變化。

如果我使用它來加載文件:

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

並有一個主節點文件:

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);

然后,只需使用:

supervisor myApp.js

將檢測文件夾/測試/變量的變化,這是一個子文件夾。

實際上,主管說它正在監控當前文件夾:

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

它還重新加載文件夾/ test中的文件,如果我使用:

supervisor -w folder myApp.js

所以,我想你可能有不同版本的主管? 我用的是0.2

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM