Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: remy/nodemon
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.19.4
Choose a base ref
...
head repository: remy/nodemon
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.0.0
Choose a head ref
  • 7 commits
  • 7 files changed
  • 4 contributors

Commits on Nov 20, 2019

  1. chore: add logo to site

    [skip ci]
    remy committed Nov 20, 2019

    Unverified

    This user has not yet uploaded their public signing key.
    Copy the full SHA
    3d90879 View commit details
  2. choe: merge master

    * refs/remotes/origin/master:
      fix: to avoid confusion like in #1528, always report used extension
      fix: langauge around "watching" (#1591)
      docs: README Grammar (#1601)
    remy committed Nov 20, 2019
    Copy the full SHA
    3a2eaf7 View commit details
  3. docs: add to faq

    [skip ci]
    remy committed Nov 20, 2019
    Copy the full SHA
    95a4c09 View commit details
  4. chore: Merge branch 'master'

    [skip ci]
    
    * 'master' of github.com:remy/nodemon:
      fix: Replace `jade` references by `pug`
      chore: test funding.yml change
      chore: update funding
      test: ensure ignore relative paths
    remy committed Nov 20, 2019
    Copy the full SHA
    b58cf7d View commit details
  5. Copy the full SHA
    0e6ba3c View commit details
  6. docs: add license file

    markokajzer authored and remy committed Nov 20, 2019
    Copy the full SHA
    6781b40 View commit details
  7. feat: update chokidar to v3

    BREAKING CHANGE:
    
    Massive CPU & RAM consumption improvements. 17x package & deps size reduction.
    radum authored and remy committed Nov 20, 2019
    Copy the full SHA
    9a67f36 View commit details
Showing with 186 additions and 1,451 deletions.
  1. +1 −2 .travis.yml
  2. +21 −0 LICENSE
  3. +22 −0 faq.md
  4. +34 −5 lib/monitor/run.js
  5. +106 −1,442 package-lock.json
  6. +2 −2 package.json
  7. BIN website/nodemon-large.png
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -5,11 +5,10 @@ cache:
notifications:
email: false
node_js:
- '12'
- '11'
- '10'
- '8'
- '6'
- '4'
before_install:
- if [ "$TRAVIS_PULL_REQUEST_BRANCH" == "" ]; then echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> .npmrc; fi
after_success:
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Remy Sharp, https://remysharp.com <remy@remysharp.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
22 changes: 22 additions & 0 deletions faq.md
Original file line number Diff line number Diff line change
@@ -301,3 +301,25 @@ Here's an example snippet of a Dockerfile:
FROM node:8.9.4-wheezy
RUN apt-get update && apt-get install -y procps
```

## "scripts is disabled on this system" on Windows

Based on [this issue](https://github.com/remy/nodemon/issues/1619), if you see the following on Windows:

```
PS> nodemon app.js
nodemon : File C:\…\nodemon.ps1 cannot be loaded because running scripts is disabled on this system. For more
information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
CategoryInfo : SecurityError: (:) [], PSSecurityException
FullyQualifiedErrorId : UnauthorizedAccess
```

The solution is as follows by [Felipe Jacob](https://github.com/adelbs):

It's a security restriction of the Windows PowerShell.

1. Open up a powershell command window (open it as administrator)
2. To check out current restrictions type "Get-ExecutionPolicy"
3. Enable powershell by typing "Set-ExecutionPolicy remotesigned"
39 changes: 34 additions & 5 deletions lib/monitor/run.js
Original file line number Diff line number Diff line change
@@ -16,6 +16,28 @@ var psTree = require('pstree.remy');
var path = require('path');
var signals = require('./signals');

function waitForSubprocesses(subprocesses, callback) {
if (Array.isArray(subprocesses) && subprocesses.length > 0) {
// check if all old subprocesses have been terminated
exec('kill -0 ' + subprocesses.join(' '), (error) => {
const returnCode = error ? error.code : 0;
if (returnCode < 126) { // ignore command not found error
const stillRunning = subprocesses.length - returnCode;
if (stillRunning > 0) {
utils.log.status('still waiting for ' + stillRunning +
' subprocess(es) to finish...');
setTimeout(waitForSubprocesses.bind(this, subprocesses, callback),
100);
return;
}
}
callback();
});
} else {
callback();
}
}

function run(options) {
var cmd = config.command.raw;

@@ -341,17 +363,24 @@ function kill(child, signal, callback) {
// configured signal (default: SIGUSR2) signal, which fixes #335
// note that psTree also works if `ps` is missing by looking in /proc
const sig = signal.replace('SIG', '');
psTree(child.pid, function (err, kids) {
psTree(child.pid, function (err, subprocesses) {
if (psTree.hasPS) {
spawn('kill', ['-s', sig, child.pid].concat(kids))
.on('close', callback);
spawn('kill', ['-s', sig].concat(subprocesses))
.on('close', waitForSubprocesses.bind(this, subprocesses,
function () {
spawn('kill', ['-s', sig, child.pid])
.on('close', callback);
}));
} else {
// make sure we kill from smallest to largest
const pids = kids.concat(child.pid).sort();
const pids = subprocesses.slice().sort();
pids.forEach(pid => {
exec('kill -' + signals[signal] + ' ' + pid, () => { });
});
callback();
waitForSubprocesses(subprocesses, function () {
exec('kill -' + signals[signal] + ' ' + child.pid, () => { });
callback();
})
}
});

Loading