2011-11-23 105 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

相关问题