Adding process.on hack example

This passes on exit codes tests on Windows, can we wrap it in a better way?