[nodejs] Abnormal Exit

2012-07-15 Thread Alan Gutierrez
I'm writing command line utilities in Node.js. Here's a snippet that is a source of some concern for me. try { options = require('arguable')(__filename); } catch (error) { console.error('error: ' + e.message); console.error(e.usage); process.exit(1); } frob

Re: [nodejs] Abnormal Exit

2012-07-15 Thread Dominic Tarr
you can throw anything in js, even an empty string. (a good way to break a test framework) would this work? stderr.on('drain', function () { process.exit(1) }) console.error('fail') On Mon, Jul 16, 2012 at 6:18 AM, Alan Gutierrez wrote: > I'm writing command line utilities in Node.js. Here's

Re: [nodejs] Abnormal Exit

2012-07-15 Thread Alan Gutierrez
On Mon, Jul 16, 2012 at 01:25:50PM +1200, Dominic Tarr wrote: > On Mon, Jul 16, 2012 at 6:18 AM, Alan Gutierrez wrote: > > I'm writing command line utilities in Node.js. Here's a snippet that is > > a source of some concern for me. > > > > try { > > options = require('arguable')(__filena

Re: [nodejs] Abnormal Exit

2012-07-15 Thread Dominic Tarr
oh, you would have to assign the 'drain' listener after you've decided to exit. On Mon, Jul 16, 2012 at 3:56 PM, Alan Gutierrez wrote: > On Mon, Jul 16, 2012 at 01:25:50PM +1200, Dominic Tarr wrote: >> On Mon, Jul 16, 2012 at 6:18 AM, Alan Gutierrez >> wrote: >> > I'm writing command line util