sysexits

Provide standard sysexits(3) exit codes.

npm install sysexits
6 downloads in the last week
20 downloads in the last month

sysexits

Provide sysexits(3) exit codes in Node.js.

Why?

It avoids having arbitrary exit codes and get them consistent with UNIX tools. For instance, an invalid CLI usage should return 64.

Install

npm install sysexits

Example

var ex = require('sysexits');

if (process.args.length < 3) {
    console.log 'error:', ex.desc[ex.USAGE]
    process.exit(ex.USAGE);
}

/* etc. */

See sysexits.js for the complete list of codes.

npm loves you