Comparing version 4.0.0 to 4.1.0
# node-dev | ||
## 4.1.0 / 2020-07-02 | ||
- Update devDependencies: | ||
- `eslint`: from `v2.0.0` to `v7.3.1` | ||
- `eslint-config-airbnb-base`: from `v3.0.1` to `v14.2.0` | ||
- `eslint-plugin-import`: from v`1.8.1` to `v2.22.0` | ||
- `tap`: from `v12.6.2` to `v14.10.7` | ||
- `touch`: from `v1.0.0` to `v3.1.0` | ||
- Removed windows restriction for `graceful_ipc` | ||
- No longer attempts to send `SIGTERM` to disconnected child processes | ||
- [package.json] Set minimum node version to 10 | ||
- [package.json] Changed test script to be more cross-platform | ||
- [tests] Split tests into 3 separate files | ||
- [tests] Removed a few opportunities for race conditions to occur | ||
- [tests] Some filesystems have single second precision, so tests now wait a minimum of 1 second before touching a file | ||
## 4.0.0 / 2019-04-22 | ||
@@ -4,0 +20,0 @@ |
@@ -45,3 +45,2 @@ var fs = require('fs'); | ||
graceful_ipc: c.graceful_ipc, | ||
ms_win: process.platform === "win32", | ||
ignore: ignore, | ||
@@ -48,0 +47,0 @@ respawn: c.respawn || false, |
var fork = require('child_process').fork; | ||
var filewatcher = require('filewatcher'); | ||
var path = require('path'); | ||
var ipc = require('./ipc'); | ||
@@ -22,3 +23,3 @@ var resolveMain = require('./resolveMain'); | ||
var wrapper = resolveMain(__dirname + '/wrap.js'); | ||
var wrapper = resolveMain(path.join(__dirname, 'wrap.js')); | ||
var main = resolveMain(script); | ||
@@ -30,3 +31,3 @@ var cfg = require('./cfg')(main, opts); | ||
// Run ./dedupe.js as preload script | ||
if (cfg.dedupe) process.env.NODE_DEV_PRELOAD = __dirname + '/dedupe'; | ||
if (cfg.dedupe) process.env.NODE_DEV_PRELOAD = path.join(__dirname, 'dedupe'); | ||
@@ -94,4 +95,4 @@ var watcher = filewatcher({ forcePolling: opts.poll }); | ||
if (!willTerminate) { | ||
if (cfg.ms_win && cfg.graceful_ipc) { | ||
log.info(`Windows workaround, sending "${cfg.graceful_ipc}" message to child.`); | ||
if (cfg.graceful_ipc) { | ||
log.info('Sending IPC: ' + JSON.stringify(cfg.graceful_ipc)); | ||
child.send(cfg.graceful_ipc); | ||
@@ -107,5 +108,5 @@ } else { | ||
process.on('SIGTERM', function () { | ||
if (child) { | ||
if (cfg.ms_win && cfg.graceful_ipc) { | ||
log.info(`Windows workaround, sending "${cfg.graceful_ipc}" message to child.`); | ||
if (child && child.connected) { | ||
if (cfg.graceful_ipc) { | ||
log.info('Sending IPC: ' + JSON.stringify(cfg.graceful_ipc)); | ||
child.send(cfg.graceful_ipc); | ||
@@ -140,3 +141,3 @@ } else { | ||
var i = mod.lastIndexOf(n); | ||
return ~i ? mod.slice(0, i + n.length) : ''; | ||
return i !== -1 ? mod.slice(0, i + n.length) : ''; | ||
} | ||
@@ -143,0 +144,0 @@ |
@@ -10,2 +10,10 @@ var util = require('util'); | ||
function noop(s) { return s; } | ||
function colorFactory(enableColor) { | ||
return enableColor ? function (s, c) { | ||
return '\x1B[' + c + 'm' + s + '\x1B[0m'; | ||
} : noop; | ||
} | ||
/** | ||
@@ -16,26 +24,23 @@ * Logs a message to the console. The level is displayed in ANSI colors, | ||
module.exports = function (cfg) { | ||
var enableColor = !(cfg.noColor || !process.stdout.isTTY); | ||
var color = colorFactory(enableColor); | ||
function log(msg, level) { | ||
if (cfg.timestamp) msg = color(fmt(cfg.timestamp), '30;1') + ' ' + msg; | ||
var timestamp = cfg.timestamp ? color(fmt(new Date(), cfg.timestamp), '39') + ' ' : ''; | ||
var c = colors[level.toLowerCase()] || '32'; | ||
console.log('[' + color(level.toUpperCase(), c) + '] ' + msg); | ||
var output = '[' + color(level.toUpperCase(), c) + '] ' + timestamp + msg; | ||
console.log(output); | ||
return output; | ||
} | ||
function color(s, c) { | ||
if (process.stdout.isTTY) { | ||
return '\x1B[' + c + 'm' + s + '\x1B[0m'; | ||
} | ||
return s; | ||
} | ||
log.info = function () { | ||
log(util.format.apply(util, arguments), 'info'); | ||
return log(util.format.apply(util, arguments), 'info'); | ||
}; | ||
log.warn = function () { | ||
log(util.format.apply(util, arguments), 'warn'); | ||
return log(util.format.apply(util, arguments), 'warn'); | ||
}; | ||
log.error = function () { | ||
log(util.format.apply(util, arguments), 'error'); | ||
return log(util.format.apply(util, arguments), 'error'); | ||
}; | ||
@@ -42,0 +47,0 @@ |
{ | ||
"name": "node-dev", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"description": "Restarts your app when files are modified", | ||
@@ -14,3 +14,4 @@ "keywords": [ | ||
"contributors": [ | ||
"Daniel Gasienica <daniel@gasienica.ch> (https://github.com/gasi/)" | ||
"Daniel Gasienica <daniel@gasienica.ch> (https://github.com/gasi)", | ||
"Bjorn Stromberg <bjorn@bjornstar.com> (https://bjornstar.com)" | ||
], | ||
@@ -28,9 +29,10 @@ "repository": { | ||
"engines": { | ||
"node": ">=6" | ||
"node": ">=10" | ||
}, | ||
"scripts": { | ||
"test": "tap test/*.js" | ||
"lint": "eslint lib test", | ||
"test": "node test" | ||
}, | ||
"dependencies": { | ||
"dateformat": "~1.0.4-1.2.3", | ||
"dateformat": "^3.0.3", | ||
"dynamic-dedupe": "^0.3.0", | ||
@@ -44,8 +46,9 @@ "filewatcher": "~3.0.0", | ||
"coffeescript": "^2.4.1", | ||
"eslint": "^2.0.0", | ||
"eslint-config-airbnb-base": "^3.0.1", | ||
"eslint-plugin-import": "^1.8.1", | ||
"tap": "^5.2.0", | ||
"touch": "^1.0.0" | ||
"eslint": "^7.3.1", | ||
"eslint-config-airbnb-base": "^14.2.0", | ||
"eslint-plugin-import": "^2.22.0", | ||
"nyc": "^15.1.0", | ||
"tap": "^14.10.7", | ||
"touch": "^3.1.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
28079
382
2
7
+ Addeddateformat@3.0.3(transitive)
- Removedarray-find-index@1.0.2(transitive)
- Removedcamelcase@2.1.1(transitive)
- Removedcamelcase-keys@2.1.0(transitive)
- Removedcurrently-unhandled@0.4.1(transitive)
- Removeddateformat@1.0.12(transitive)
- Removeddecamelize@1.2.0(transitive)
- Removederror-ex@1.3.2(transitive)
- Removedfind-up@1.1.2(transitive)
- Removedget-stdin@4.0.1(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhosted-git-info@2.8.9(transitive)
- Removedindent-string@2.1.0(transitive)
- Removedis-arrayish@0.2.1(transitive)
- Removedis-finite@1.1.0(transitive)
- Removedis-utf8@0.2.1(transitive)
- Removedload-json-file@1.1.0(transitive)
- Removedloud-rejection@1.6.0(transitive)
- Removedmap-obj@1.0.1(transitive)
- Removedmeow@3.7.0(transitive)
- Removednormalize-package-data@2.5.0(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedparse-json@2.2.0(transitive)
- Removedpath-exists@2.1.0(transitive)
- Removedpath-type@1.1.0(transitive)
- Removedpify@2.3.0(transitive)
- Removedpinkie@2.0.4(transitive)
- Removedpinkie-promise@2.0.1(transitive)
- Removedread-pkg@1.1.0(transitive)
- Removedread-pkg-up@1.0.1(transitive)
- Removedredent@1.0.0(transitive)
- Removedrepeating@2.0.1(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedspdx-correct@3.2.0(transitive)
- Removedspdx-exceptions@2.5.0(transitive)
- Removedspdx-expression-parse@3.0.1(transitive)
- Removedspdx-license-ids@3.0.20(transitive)
- Removedstrip-bom@2.0.0(transitive)
- Removedstrip-indent@1.0.1(transitive)
- Removedtrim-newlines@1.0.0(transitive)
- Removedvalidate-npm-package-license@3.0.4(transitive)
Updateddateformat@^3.0.3