sysexits

v1.0.1
Provide standard sysexits(3) exit codes.
code exit sysexits return error cli command

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 Exit = require('sysexits');

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

/* etc. */

See sysexits.js for the complete list of codes.

npm i sysexits

Metadata

  • Unknown
  • >=0.8.0
  • Jean Lauliac
  • released 1/23/2015

Downloads

Maintainers