source: trip-planner-front/node_modules/errno/cli.js@ 76712b2

Last change on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 440 bytes
Line 
1#!/usr/bin/env node
2
3var errno = require('./')
4 , arg = process.argv[2]
5 , data, code
6
7if (arg === undefined) {
8 console.log(JSON.stringify(errno.code, null, 2))
9 process.exit(0)
10}
11
12if ((code = +arg) == arg)
13 data = errno.errno[code]
14else
15 data = errno.code[arg] || errno.code[arg.toUpperCase()]
16
17if (data)
18 console.log(JSON.stringify(data, null, 2))
19else {
20 console.error('No such errno/code: "' + arg + '"')
21 process.exit(1)
22}
Note: See TracBrowser for help on using the repository browser.