What is the problem this feature will solve?
This is the default behavior in nodemon and would allow to automatically restart a script (in my case a web server) when an error forces the script to exit.
Example:
When running the sample file fail.js using node --watch=fail.ts fail.js, the following output is generated
Exit with code 1
Failed running 'fail.js'
but the script is actually not restarted as I would have expected from the default behavior in nodemon that I'm trying to replace.
const exitCode = 1;
console.log(`Exit with code ${exitCode}`);
process.exit(exitCode);
What is the feature you are proposing to solve the problem?
Either automatically restart the script when it exists with an error code when --watch is used automatically or add a specific cli option (--watch-restart-on-error) that enables this.
What alternatives have you considered?
Sticking with nodemon
What is the problem this feature will solve?
This is the default behavior in
nodemonand would allow to automatically restart a script (in my case a web server) when an error forces the script to exit.Example:
When running the sample file
fail.jsusingnode --watch=fail.ts fail.js, the following output is generatedExit with code 1 Failed running 'fail.js'but the script is actually not restarted as I would have expected from the default behavior in
nodemonthat I'm trying to replace.What is the feature you are proposing to solve the problem?
Either automatically restart the script when it exists with an error code when --watch is used automatically or add a specific cli option (--watch-restart-on-error) that enables this.
What alternatives have you considered?
Sticking with
nodemon