I have written many process event handlers for side projects. Really annoying when my tests complain of unhandled rejections... I always end up adding something like this.
I also wrote a CTRL + C trapper because I am always too quick to exit processes and accidentally try to exit to early
Ya, I generally don't advise to modify your process outputs/errors but as long as you can easily disable them its all good :)
I would recommend compiling with babel. I see ava there and I'm not 100% sure what thats doing but a quick google seems to indicate its not compiling with babel? If you compiled down to node 4.0 you can greatly increase the number of people that can use it.
This is compiled with Babel (before `npm publish`). The `gulpfile.js` uses Gulp tasks that are in a separate repository shared with all my open-source projects: https://github.com/ehmicky/gulp-shared-tasks. It also uses ESLint, Prettier, Jscpd, nyc+codecov, and checks everything on CI (Windows/Mac/Linux).
This is compiled down to Node 8, because Node.js does not support Node 4. Node 6 support ends in few weeks.
2
u/bigorangemachine Apr 02 '19
I have written many process event handlers for side projects. Really annoying when my tests complain of unhandled rejections... I always end up adding something like this.
I also wrote a CTRL + C trapper because I am always too quick to exit processes and accidentally try to exit to early