How to use the nodemon.once 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 chrisblossom / react-universal-starter / tools / watch_server.js View on Github external
return new Promise(async resolve => {
        await compileServer({ watch: true });

        /**
         * https://github.com/remy/nodemon/blob/master/doc/requireable.md
         */
        nodemon({
            script: path.resolve(rootPath, 'start.js'),
            watch: serverBuildPath,
            // delay: 500,
        });

        nodemon.once('start', () => {
            resolve();
        });

        /**
         * Fix for terminal error
         * https://github.com/JacksonGariety/gulp-nodemon/issues/77#issuecomment-277749901
         */
        nodemon.on('quit', () => {
            process.exit();
        });
    });
}
github borisding / universsr / bin / scripts / dev.js View on Github external
process.stdin.on('data', data => {
      data = data.toString().trim();
      if (data.length === 1 && data.charCodeAt(0) === 113) {
        nodemon
          .once('exit', () => {
            process.exit();
          })
          .emit('quit');
      }
    });
  } catch (error) {
github Asymmetrik / graphql-fhir / src / scripts / nodemon.js View on Github external
process.once('SIGINT', () => {
	nodemon.once('exit', () => {
		logger.info('Exiting Nodemon.');
		process.exit();
	});
});

nodemon

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

MIT
Latest version published 2 months ago

Package Health Score

97 / 100
Full package analysis