These are chat archives for nebrius/raspi-io

3rd
Apr 2018
Luis
@enginebeat
Apr 03 2018 09:59
Hi Bryan, Thank you for the heads up. I am relatively new to nodejs and javascript and dealing with the async nature of it is a bit of headache, specially coming from C and C++. The program was just a first test of the raspi module and needs improving.
Hi Brian,
I do use the ctrl+c to terminate the app, as I didn't know that there were other ways to do this. This is the great thing about talking to other people about hte issues you are having it leads you into looking into other things that are useful.
I just made a search on ways to terminate a Nodejs app and it seems that people are a bit devided on how best to do it...
Luis
@enginebeat
Apr 03 2018 10:04
process. exit() seems to be a favorite, but I need a way to cleanly terminate from the CLI. some also use exit().
Luis
@enginebeat
Apr 03 2018 10:09
Any info on how would you normally exit from the server side app would be welcomed as ctrl+c seems a bit crude. Than you.
Bryan Hughes
@nebrius
Apr 03 2018 16:34
process.exit(<exit code>) is the recommended way from code, and ctrl+c is the recommended way from the command line. I don’t think it’s crude myself, as apps can hook into process.on(‘beforeExit’) or process.on(‘exit’) to clean themselves up when ctrl+c is hit
Brian Cooke
@fivdi
Apr 03 2018 19:29
If it's not broken don't fix it :) I'd stick with ctrl+c.
Luis
@enginebeat
Apr 03 2018 21:30
Thanks guys, will stick with it.