mirror of
https://github.com/SrIzan10/nodemon.git
synced 2026-05-01 10:55:09 +00:00
- Events documented - Require working nicely - If nodemon is required, nodemon message are emitted rather than console.log'ged
39 lines
842 B
JavaScript
39 lines
842 B
JavaScript
'use strict';
|
|
var noop = function () {};
|
|
|
|
var utils = module.exports = {
|
|
clone: require('./clone'),
|
|
merge: require('./merge'),
|
|
bus: require('./bus'),
|
|
isWindows: process.platform === 'win32',
|
|
isRequired: (function () {
|
|
var p = module;
|
|
while (p = p.parent) {
|
|
if (p.filename.indexOf('bin/nodemon.js') !== -1) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
})(),
|
|
home: process.env.HOME || process.env.HOMEPATH,
|
|
quiet: function () {
|
|
// nukes the logging
|
|
if (!this.debug) {
|
|
Object.keys(this.log).forEach(function (method) {
|
|
this.log[method] = noop;
|
|
}.bind(this));
|
|
}
|
|
}
|
|
};
|
|
|
|
utils.log = require('./log')(utils.isRequired);
|
|
|
|
Object.defineProperty(utils, 'debug', {
|
|
set: function (value) {
|
|
this.log.debug = value;
|
|
},
|
|
get: function () {
|
|
return this.log.debug;
|
|
}
|
|
}); |