node-supervisor

Node.js: Check if file is an symbolic link when iterating over directory with 'fs'

白昼怎懂夜的黑 提交于 2020-01-03 08:34:13
问题 Supervisor is a package for Node.js that monitors files in your app directory for modifications and reloads the app when a modification occurs. This script interprets symbolic links as regular files and logs out a warning. I would like to fork Supervisor so that either this can be fixed entirely or that a more descriptive warning is produced. How can I use the File System module of Node.js to determine if a given file is really an symbolic link? 回答1: You can use fs.lstat and then call statis

Supervisor node .js “Program node app exited with code 0” error

江枫思渺然 提交于 2019-12-03 09:47:25
问题 When I install an express scaffold app express Then run the npm install npm install and then run supervisor supervisor app I get Starting child process with 'node app' Program node app exited with code 0 The app.js file is a basic default express instance. var express = require('express'); var path = require('path'); var favicon = require('static-favicon'); var logger = require('morgan'); var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); var routes =

Run node.js application in debug with supervisor

你说的曾经没有我的故事 提交于 2019-12-03 03:51:37
问题 I am using supervisor to auto-reload my node.js, e.g. supervisor -w . app.js However I can't work out how to get supervisor to run the node.js process in debug, e.g. the equivalent to node --debug app.coffee Anyone got any ideas? 回答1: This solution will work for *nix: Go to /usr/local/bin or any other directory in your $PATH $ cd /usr/local/bin Create an executable script (say, node-debug) with the following contents #!/bin/bash node --debug $@ To make it executable: $ sudo chmod 777 /usr

Run node.js application in debug with supervisor

这一生的挚爱 提交于 2019-12-02 17:15:27
I am using supervisor to auto-reload my node.js, e.g. supervisor -w . app.js However I can't work out how to get supervisor to run the node.js process in debug, e.g. the equivalent to node --debug app.coffee Anyone got any ideas? This solution will work for *nix: Go to /usr/local/bin or any other directory in your $PATH $ cd /usr/local/bin Create an executable script (say, node-debug) with the following contents #!/bin/bash node --debug $@ To make it executable: $ sudo chmod 777 /usr/local/bin/node-debug Now you can run supervisor like this: $ supervisor -x node-debug script.js P.S.: To round