How to use the nodemon.restart function in nodemon

To help you get started, we’ve selected a few nodemon examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gaearon / react-blessed-hot-motion / server.js View on Github external
running = true;
    nodemon({
      execMap: {
        js: 'node'
      },
      script: path.join(__dirname, 'build', 'backend'),
      ignore: ['*'],
      watch: ['foo/'],
      ext: 'noop'
    });
  }

  // There's a trick here. Restart will just send SIGUSR2 to our process.
  // src/signal.js will intercept it and handle hot update instead of restarting.

  nodemon.restart();
});
github jlongster / jlongster-rebuild / gulpfile.js View on Github external
).on('end', function() {
    nodemon.restart();
    cb();
  });
});
github dferber90 / webapp / bundling / scripts / start-dev.js View on Github external
serverCompiler.plugin('done', function () {
    log.info('webpack', 'Bundled server in ' + (Date.now() - bundleStart) + 'ms!')
    if (startedServer) {
      nodemon.restart()
    } else {
      startedServer = true
      startServer()

      registerRefreshListener()
    }
  })
github getstalkr / email-sender / build / index.js View on Github external
webpack(config).watch(100, () => {
    if (runner) {
      log(chalk.gray('Restarting...'))
      nodemon.restart()
    } else {
      starter.succeed('Built!')
      runner = run()
    }
  })
github dferber90 / webapp / bundling / scripts / start-api.js View on Github external
apiCompiler.plugin('done', function (stats) {
  if (!canContinue('server-api', false, stats)) return
  log.info('webpack', 'Bundled server-api in ' + (Date.now() - bundleClientStart) + 'ms!')

  if (startedServer) {
    nodemon.restart()
  } else {
    nodemon({
      execMap: {
        js: 'node',
      },
      script: path.join(__dirname, '..', '..', 'build', 'api', 'server-api.js'),
      ignore: ['*'],
      watch: ['nothing/'],
      ext: 'noop',
    })

    nodemon
      .on('quit', () => log.info('nodemon', 'server-api: stopped server. bye'))
      .on('exit', () => log.info('nodemon', 'server-api: nodemon exited'))
      .on('crash', () => log.info('nodemon', 'server-api: nodemon crashed'))
      .on('stderr', () => log.info('nodemon', 'server-api: nodemon stderr'))
github samtgarson / micro-starter / build / index.js View on Github external
webpack(config).watch(100, () => {
    if (runner) {
      log(chalk.gray('Restarting...'))
      nodemon.restart()
    } else {
      starter.succeed('Built!')
      runner = run()
    }
  })
} else {
github bmcmahen / hamilton-history-of-medicine / gulpfile.js View on Github external
webpack(serverDev).watch(100, function (err, stats) {
    onBuild()(err, stats)
    if (running) {
      nodemon.restart()
    }
  })
})
github jlongster / backend-with-webpack / gulpfile.js View on Github external
webpack(backendConfig).watch(100, function(err, stats) {
    if(!firedDone) {
      firedDone = true;
      done();
    }

    nodemon.restart();
  });
});
github zxbodya / reactive-widgets / tools / dev-server.js View on Github external
.switchMap(({ status }) => {
    if (status === 'done') {
      nodemon.restart();
      return nodemonStart$
        .first()
        .flatMap(() => waitForPort(appPort, appHost))
        .map(() => true);
    }
    return [false];
  })
  .distinctUntilChanged();
github vslinko / esex / gulpfile.babel.js View on Github external
onChange: () => {
        nodemon.restart()
      }
    }))

nodemon

Simple monitor script for use during development of a Node.js app.

MIT
Latest version published 12 days ago

Package Health Score

87 / 100
Full package analysis