2011-11-23 87 views

回答

3

似乎正在工作,並檢測到我的變化。

如果我用這個來加載文件:

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' 

它也重裝文件夾中的文件/測試,如果我使用:

supervisor -w folder myApp.js 

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

7

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

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

爲**所有擴展**,你可以使用'主管-e「」 app.js' – Falcon

+0

不知道這是否可用4年前:) – chovy

相關問題