This repository has been archived by the owner on Dec 23, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
npm-debug.log
112 lines (112 loc) · 30.8 KB
/
npm-debug.log
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'publish' ]
2 info using npm@1.4.24
3 info using node@v0.10.30
4 verbose publish [ '.' ]
5 verbose cache add [ '.', null ]
6 verbose cache add name=undefined spec="." args=[".",null]
7 verbose parsed url { protocol: null,
7 verbose parsed url slashes: null,
7 verbose parsed url auth: null,
7 verbose parsed url host: null,
7 verbose parsed url port: null,
7 verbose parsed url hostname: null,
7 verbose parsed url hash: null,
7 verbose parsed url search: null,
7 verbose parsed url query: null,
7 verbose parsed url pathname: '.',
7 verbose parsed url path: '.',
7 verbose parsed url href: '.' }
8 silly lockFile 3a52ce78- .
9 verbose lock . /Users/craig/.npm/3a52ce78-.lock
10 verbose tar pack [ '/Users/craig/.npm/celeri/0.3.3/package.tgz', '.' ]
11 verbose tarball /Users/craig/.npm/celeri/0.3.3/package.tgz
12 verbose folder .
13 info prepublish celeri@0.3.3
14 silly lockFile 1f1177db-tar tar://.
15 verbose lock tar://. /Users/craig/.npm/1f1177db-tar.lock
16 silly lockFile 143199a9-aig-npm-celeri-0-3-3-package-tgz tar:///Users/craig/.npm/celeri/0.3.3/package.tgz
17 verbose lock tar:///Users/craig/.npm/celeri/0.3.3/package.tgz /Users/craig/.npm/143199a9-aig-npm-celeri-0-3-3-package-tgz.lock
18 silly lockFile 1f1177db-tar tar://.
19 silly lockFile 1f1177db-tar tar://.
20 silly lockFile 143199a9-aig-npm-celeri-0-3-3-package-tgz tar:///Users/craig/.npm/celeri/0.3.3/package.tgz
21 silly lockFile 143199a9-aig-npm-celeri-0-3-3-package-tgz tar:///Users/craig/.npm/celeri/0.3.3/package.tgz
22 silly lockFile d7ee5b7f-s-craig-npm-celeri-0-3-3-package /Users/craig/.npm/celeri/0.3.3/package
23 verbose lock /Users/craig/.npm/celeri/0.3.3/package /Users/craig/.npm/d7ee5b7f-s-craig-npm-celeri-0-3-3-package.lock
24 silly lockFile d7ee5b7f-s-craig-npm-celeri-0-3-3-package /Users/craig/.npm/celeri/0.3.3/package
25 silly lockFile d7ee5b7f-s-craig-npm-celeri-0-3-3-package /Users/craig/.npm/celeri/0.3.3/package
26 silly lockFile 3a52ce78- .
27 silly lockFile 3a52ce78- .
28 silly publish { name: 'celeri',
28 silly publish description: 'CLI lib',
28 silly publish version: '0.3.3',
28 silly publish author: { name: 'Craig Condon' },
28 silly publish repository: { type: 'git', url: 'http://github.com/crcn/celeri.git' },
28 silly publish directories: { lib: './lib' },
28 silly publish dependencies:
28 silly publish { colors: '0.5.x',
28 silly publish disposable: '0.0.x',
28 silly publish outcome: '0.0.x',
28 silly publish structr: '0.2.x',
28 silly publish underscore: '1.2.x',
28 silly publish tq: '0.0.x',
28 silly publish crema: '0.1.x',
28 silly publish beanpoll: '0.2.x',
28 silly publish plugin: '0.3.x',
28 silly publish keypress: '0.1.x',
28 silly publish dsync: '0.0.x' },
28 silly publish main: './lib/index.js',
28 silly publish readme: '### C-e-L-er-I\n\n![Alt command line](http://i.imgur.com/DA77U.png)\n\n### Features:\n\n- History (up/down arrows)\n- Progress Bar\n- Loading/busy spinner\n- Password input\n- Confirmation \n- Prompt\n- Parse command line args\n- help menu, and sub help menu\n- Multi-line tables\n- Build flexible commands via [beanpole](https://github.com/spiceapps/beanpole)\n - OR statement \n - Middleware\n - Parameters \n- Trees\n- *Exposing Javascript*, and calling it from the command line - inspired by mongo\'s CLI utilitiy\n\n### To Do:\n\n- Help menu api\n- Title View \n- Custom colors for each view (input, loader, progress, table, etc.): exports.colors = {}\n- Error handling (display of command not found)\n- Add transports instead of depending on native stdin/stdout\n - Ability to use online\n\n\n\n## Usage:\n\n\n### .option(cmdOrOps, descOrCallback, callback)\n\nListens for a key (enter, up, left, backspace, etc.), or command. See [beanpole](https://github.com/spiceapps/beanpole) for documentation.\n\n#### Hello World: \n\n```javascript\n\nvar celeri = require(\'celeri\');\n\n//an option with info for the help menu\nceleri.option({\n command: \'hello :person\',\n description: \'Prints "hello [person]!"\',\n optional: {\n \'--age\': \'The person\\\'s age\',\n \'--gender\': \'The person\\\'s gender\'\n }\n}, function(data) {\n\n console.log("Hello %s!", data.person);\n \n if(data.age) console.log("%s is %d years old.", data.person, data.age); \n if(data.gender) console.log("%s is a %s.", data.person, data.gender); \n\n});\n\n//parse the command line args\nceleri.parse(process.argv);\n\n```\n\nInteractive in terminal:\n \n```\n# node ./cmd ↩\n> hello craig ↩\nhello craig!\n```\n\npassed as arguments:\n\n```\n# node ./hello hello craig --age=21 --gender=cat ↩\nhello craig!\ncraig is 21 years old.\ncraig is a cat.\n```\n\nHelp menu:\n\n```\n# node ./cmd help ↩\n\nUsage: [command] --arg=value --arg2\n\nHelp:\n help Show help menu\n [cmd] help Show command help menu\n\nCommands:\n hello Prints "hello [person]!""\n\n```\n\nCommand Specific help menu:\n\n```\n# node ./cmd hello help ↩\n\nPrints "hello [person]!""\n\nUsage: hello [person]\n\nOptional Flags: \n --age The person\'s age\n --gender The person\'s gender\n```\n\n\n\n### .usage(value)\n\nSets the help menu usage text\n\n```javascript\nceleri.usage(\'[command] --arg=value\');\n```\n\n\n#### "OR" statement:\n\n```javascript\n\n\nceleri.option(\'hello :name OR hi :name\', \'some description\', function(data)\n{\n\tconsole.log(\'Hello \' + data.name +\'!\');\n}).\noption(\'set address :zip OR set address :city :state :zip\', function(data)\n{\n\tconsole.log("City: %s, State: %s, Zip: %s ", data.city || \'None provided\', data.state || \'None provided\', data.zip);\n});\n\n```\n\n### .onJs(api)\n\nYou can easily expose javascript functions by providing an object:\n\n```javascript\n\n\nvar api = {\n sayHello: function(name) {\n console.log("hello %s!", name || \'craig\');\n }\n}\n\nceleri.onJs({ api: api });\n\n```\n\nIn terminal:\n \n node ./hello ↩\n > api.sayHello("john"); ↩\n hello john!\n\n### .progress(label, percent)\n\n```javascript\n\nvar i = 0;\n\nvar interval = setInterval(function()\n{\n\tceleri.progress(\'Label: \', i++);\n\t\n\tif(i == 100) clearInterval(interval);\n}, 10);\n\n```\n\n### .loading(label)\n\n```javascript\n\nvar spinner = celeri.loading(\'Processing: \');\n\nsetTimeout(function()\n{\n\tspinner.done(true);//undefined = done, true = success, false = fail\n}, 1000);\n\n````\n\n### .prompt(label, callback)\n\n```javascript\n\nceleri.prompt(\'Username: \', function(input)\n{\n\t\n});\n\n````\n\n### .confirm(message, callback)\n\n```javascript\n\nceleri.confirm("Do you want to continue?", function(yes)\n{\n\tif(yes)\n\t{\n\t\t//continue\n\t}\n});\n\n```\n\n### .password(label[, mask], callback)\n\n```javascript\n\t\n//mask = *\nceleri.password(\'Password: \', \'*\', function(input)\n{\n\t//password\n});\n\n//no mask\nceleri.password(\'Password: \', function(input)\n{\n\t//password\n});\n\n```\n\n### .auth(callback)\n\n```javascript\n\nceleri.auth(function(user, pass)\n{\n\t//auth here\n});\n\n```\n\n\n### .drawTable(objects, ops)\n\n```javascript\n\nvar objects = [\n \n {\n name: \'Craig\',\n age: 21,\n interests: \'Cooking, espresso, backpacking, coding\'\n },\n \n \n {\n name: \'Tim\',\n age: 21,\n interests: \'Design, Traveling, Photography\'\n \n }\n\n];\n\nceleri.drawTable(objects, {\n columns: [\'name\',\'age\',\'interests\']\n});\n\n\n``` \n\n\nGives you something like:\n\n\n![Alt command line](http://i.imgur.com/oUtC9.png)\n\n\nHere\'s a multi-line table:\n\n\n![Alt command line](http://i.imgur.com/O5o47.png) \n\n### .drawTree(tree) \n\nDraws a tree\n\n````javascript\n \n//print out the contents of the celeri object\nceleri.drawTree(celeri); \n\n````\n\nHere\'s another example:\n\n![Alt command line](http://i.imgur.com/4F0e0.png)\n\n\n### Let\'s kick it up a notch\n\n\n```javascript\n\nvar celeri = require(\'../lib\');\n\n\nvar credentials;\n\n\n \nceleri.option(\'login OR login :user :pass\', function(data)\n{\n \n //reference to the current request\n var self = this;\n \n\n //called after auth credentials have been entered in\n function onAuth(creds)\n {\n\n //credits wrong? DO NOT CONTINUE\n if(creds.user != \'user\' || creds.pass != \'pass\')\n {\n return console.log("Incorrect user / pass".red);\n }\n \n //otherwise, add the user to the CURRENT request so it can be passed\n //onto the next route listener\n self.user = creds.user;\n \n //cache the credentials so the user doesn\'t have to login each time\n credentials = creds;\n \n //not another listener? display a success response\n if(!self.next()) console.log("Logged in as %s", creds.user.green);\n }\n \n \n //user already logged in? pass!\n if(credentials)\n {\n onAuth(credentials);\n }\n \n //otherwise check if the user is passed in the route\n else\n if(data.user && data.pass)\n {\n onAuth(data);\n }\n \n //or prompt for authentication\n else\n {\n celeri.auth(function(user, pass)\n {\n onAuth({ user: user, pass: pass });\n });\n }\n});\n\n\n\n/**\n * This stuff\'s private. The user has to be authenticated *before* this command is executed\n */\n \nceleri.option(\'login -> account\', function()\n{\n console.log(\'Here\\\'s your account info %s!\', this.user.green);\n});\n\nceleri.open();\n\n\n\nceleri.parse(process.argv);\n\n\n```\n\nHere\'s what you get:\n\n![Alt command line](http://i.imgur.com/g7ywq.png)\n\n\n',
28 silly publish readmeFilename: 'README.md',
28 silly publish gitHead: '9524ec5fd8a11ba3864c95370250b39cb8cda721',
28 silly publish bugs: { url: 'https://github.com/crcn/celeri/issues' },
28 silly publish homepage: 'https://github.com/crcn/celeri',
28 silly publish _id: 'celeri@0.3.3',
28 silly publish scripts: {},
28 silly publish _shasum: 'c928976294fa87db395b17f9ff4bc02c7073877e',
28 silly publish _from: '.' }
29 verbose request where is /celeri
30 verbose request registry http://registry.npmjs.org/
31 verbose request id 492647be4cedf87f
32 verbose url raw /celeri
33 verbose url resolving [ 'http://registry.npmjs.org/', './celeri' ]
34 verbose url resolved http://registry.npmjs.org/celeri
35 verbose request where is http://registry.npmjs.org/celeri
36 info trying registry request attempt 1 at 09:52:21
37 http PUT http://registry.npmjs.org/celeri
38 http 403 http://registry.npmjs.org/celeri
39 verbose headers { server: 'CouchDB/1.5.0 (Erlang OTP/R14B04)',
39 verbose headers 'content-type': 'application/json',
39 verbose headers 'cache-control': 'max-age=60',
39 verbose headers 'content-length': '20118',
39 verbose headers 'accept-ranges': 'bytes',
39 verbose headers date: 'Mon, 01 Sep 2014 16:52:22 GMT',
39 verbose headers via: '1.1 varnish',
39 verbose headers connection: 'keep-alive',
39 verbose headers 'x-served-by': 'cache-lax1430-LAX',
39 verbose headers 'x-cache': 'MISS',
39 verbose headers 'x-cache-hits': '0',
39 verbose headers 'x-timer': 'S1409590341.771219,VS0,VE241' }
40 error publish Failed PUT 403
41 error Error: forbidden cannot modify pre-existing version: 0.3.3
41 error old={"name":"celeri","description":"CLI lib","version":"0.3.3","author":{"name":"Craig Condon"},"repository":{"type":"git","url":"http://github.com/crcn/celeri.git"},"directories":{"lib":"./lib"},"dependencies":{"colors":"0.5.x","disposable":"0.0.x","outcome":"0.0.x","structr":"0.2.x","underscore":"1.2.x","tq":"0.0.x","crema":"0.1.x","beanpoll":"0.2.x","plugin":"0.3.x","keypress":"0.1.x","dsync":"0.0.x"},"main":"./lib/index.js","readme":"### C-e-L-er-I\u000a\u000a![Alt command line](http://i.imgur.com/DA77U.png)\u000a\u000a### Features:\u000a\u000a- History (up/down arrows)\u000a- Progress Bar\u000a- Loading/busy spinner\u000a- Password input\u000a- Confirmation \u000a- Prompt\u000a- Parse command line args\u000a- help menu, and sub help menu\u000a- Multi-line tables\u000a- Build flexible commands via [beanpole](https://github.com/spiceapps/beanpole)\u000a - OR statement \u000a - Middleware\u000a - Parameters \u000a- Trees\u000a- *Exposing Javascript*, and calling it from the command line - inspired by mongo's CLI utilitiy\u000a\u000a### To Do:\u000a\u000a- Help menu api\u000a- Title View \u000a- Custom colors for each view (input, loader, progress, table, etc.): exports.colors = {}\u000a- Error handling (display of command not found)\u000a- Add transports instead of depending on native stdin/stdout\u000a - Ability to use online\u000a\u000a\u000a\u000a## Usage:\u000a\u000a\u000a### .option(cmdOrOps, descOrCallback, callback)\u000a\u000aListens for a key (enter, up, left, backspace, etc.), or command. See [beanpole](https://github.com/spiceapps/beanpole) for documentation.\u000a\u000a#### Hello World: \u000a\u000a```javascript\u000a\u000avar celeri = require('celeri');\u000a\u000a//an option with info for the help menu\u000aceleri.option({\u000a command: 'hello :person',\u000a description: 'Prints \"hello [person]!\"',\u000a optional: {\u000a '--age': 'The person\\'s age',\u000a '--gender': 'The person\\'s gender'\u000a }\u000a}, function(data) {\u000a\u000a console.log(\"Hello %s!\", data.person);\u000a \u000a if(data.age) console.log(\"%s is %d years old.\", data.person, data.age); \u000a if(data.gender) console.log(\"%s is a %s.\", data.person, data.gender); \u000a\u000a});\u000a\u000a//parse the command line args\u000aceleri.parse(process.argv);\u000a\u000a```\u000a\u000aInteractive in terminal:\u000a \u000a```\u000a# node ./cmd ↩\u000a> hello craig ↩\u000ahello craig!\u000a```\u000a\u000apassed as arguments:\u000a\u000a```\u000a# node ./hello hello craig --age=21 --gender=cat ↩\u000ahello craig!\u000acraig is 21 years old.\u000acraig is a cat.\u000a```\u000a\u000aHelp menu:\u000a\u000a```\u000a# node ./cmd help ↩\u000a\u000aUsage: [command] --arg=value --arg2\u000a\u000aHelp:\u000a help Show help menu\u000a [cmd] help Show command help menu\u000a\u000aCommands:\u000a hello Prints \"hello [person]!\"\"\u000a\u000a```\u000a\u000aCommand Specific help menu:\u000a\u000a```\u000a# node ./cmd hello help ↩\u000a\u000aPrints \"hello [person]!\"\"\u000a\u000aUsage: hello [person]\u000a\u000aOptional Flags: \u000a --age The person's age\u000a --gender The person's gender\u000a```\u000a\u000a\u000a\u000a### .usage(value)\u000a\u000aSets the help menu usage text\u000a\u000a```javascript\u000aceleri.usage('[command] --arg=value');\u000a```\u000a\u000a\u000a#### \"OR\" statement:\u000a\u000a```javascript\u000a\u000a\u000aceleri.option('hello :name OR hi :name', 'some description', function(data)\u000a{\u000a\u0009console.log('Hello ' + data.name +'!');\u000a}).\u000aoption('set address :zip OR set address :city :state :zip', function(data)\u000a{\u000a\u0009console.log(\"City: %s, State: %s, Zip: %s \", data.city || 'None provided', data.state || 'None provided', data.zip);\u000a});\u000a\u000a```\u000a\u000a### .onJs(api)\u000a\u000aYou can easily expose javascript functions by providing an object:\u000a\u000a```javascript\u000a\u000a\u000avar api = {\u000a sayHello: function(name) {\u000a console.log(\"hello %s!\", name || 'craig');\u000a }\u000a}\u000a\u000aceleri.onJs({ api: api });\u000a\u000a```\u000a\u000aIn terminal:\u000a \u000a node ./hello ↩\u000a > api.sayHello(\"john\"); ↩\u000a hello john!\u000a\u000a### .progress(label, percent)\u000a\u000a```javascript\u000a\u000avar i = 0;\u000a\u000avar interval = setInterval(function()\u000a{\u000a\u0009celeri.progress('Label: ', i++);\u000a\u0009\u000a\u0009if(i == 100) clearInterval(i);\u000a}, 10);\u000a\u000a```\u000a\u000a### .loading(label)\u000a\u000a```javascript\u000a\u000avar spinner = celeri.loading('Processing: ');\u000a\u000asetTimeout(function()\u000a{\u000a\u0009spinner.done(true);//undefined = done, true = success, false = fail\u000a}, 1000);\u000a\u000a````\u000a\u000a### .prompt(label, callback)\u000a\u000a```javascript\u000a\u000aceleri.prompt('Username: ', function(input)\u000a{\u000a\u0009\u000a});\u000a\u000a````\u000a\u000a### .confirm(message, callback)\u000a\u000a```javascript\u000a\u000aceleri.confirm(\"Do you want to continue?\", function(yes)\u000a{\u000a\u0009if(yes)\u000a\u0009{\u000a\u0009\u0009//continue\u000a\u0009}\u000a});\u000a\u000a```\u000a\u000a### .password(label[, mask], callback)\u000a\u000a```javascript\u000a\u0009\u000a//mask = *\u000aceleri.password('Password: ', '*', function(input)\u000a{\u000a\u0009//password\u000a});\u000a\u000a//no mask\u000aceleri.password('Password: ', function(input)\u000a{\u000a\u0009//password\u000a});\u000a\u000a```\u000a\u000a### .auth(callback)\u000a\u000a```javascript\u000a\u000aceleri.auth(function(user, pass)\u000a{\u000a\u0009//auth here\u000a});\u000a\u000a```\u000a\u000a\u000a### .drawTable(objects, ops)\u000a\u000a```javascript\u000a\u000avar objects = [\u000a \u000a {\u000a name: 'Craig',\u000a age: 21,\u000a interests: 'Cooking, espresso, backpacking, coding'\u000a },\u000a \u000a \u000a {\u000a name: 'Tim',\u000a age: 21,\u000a interests: 'Design, Traveling, Photography'\u000a \u000a }\u000a\u000a];\u000a\u000aceleri.drawTable(objects, {\u000a columns: ['name','age','interests']\u000a});\u000a\u000a\u000a``` \u000a\u000a\u000aGives you something like:\u000a\u000a\u000a![Alt command line](http://i.imgur.com/oUtC9.png)\u000a\u000a\u000aHere's a multi-line table:\u000a\u000a\u000a![Alt command line](http://i.imgur.com/O5o47.png) \u000a\u000a### .drawTree(tree) \u000a\u000aDraws a tree\u000a\u000a````javascript\u000a \u000a//print out the contents of the celeri object\u000aceleri.drawTree(celeri); \u000a\u000a````\u000a\u000aHere's another example:\u000a\u000a![Alt command line](http://i.imgur.com/4F0e0.png)\u000a\u000a\u000a### Let's kick it up a notch\u000a\u000a\u000a```javascript\u000a\u000avar celeri = require('../lib');\u000a\u000a\u000avar credentials;\u000a\u000a\u000a \u000aceleri.option('login OR login :user :pass', function(data)\u000a{\u000a \u000a //reference to the current request\u000a var self = this;\u000a \u000a\u000a //called after auth credentials have been entered in\u000a function onAuth(creds)\u000a {\u000a\u000a //credits wrong? DO NOT CONTINUE\u000a if(creds.user != 'user' || creds.pass != 'pass')\u000a {\u000a return console.log(\"Incorrect user / pass\".red);\u000a }\u000a \u000a //otherwise, add the user to the CURRENT request so it can be passed\u000a //onto the next route listener\u000a self.user = creds.user;\u000a \u000a //cache the credentials so the user doesn't have to login each time\u000a credentials = creds;\u000a \u000a //not another listener? display a success response\u000a if(!self.next()) console.log(\"Logged in as %s\", creds.user.green);\u000a }\u000a \u000a \u000a //user already logged in? pass!\u000a if(credentials)\u000a {\u000a onAuth(credentials);\u000a }\u000a \u000a //otherwise check if the user is passed in the route\u000a else\u000a if(data.user && data.pass)\u000a {\u000a onAuth(data);\u000a }\u000a \u000a //or prompt for authentication\u000a else\u000a {\u000a celeri.auth(function(user, pass)\u000a {\u000a onAuth({ user: user, pass: pass });\u000a });\u000a }\u000a});\u000a\u000a\u000a\u000a/**\u000a * This stuff's private. The user has to be authenticated *before* this command is executed\u000a */\u000a \u000aceleri.option('login -> account', function()\u000a{\u000a console.log('Here\\'s your account info %s!', this.user.green);\u000a});\u000a\u000aceleri.open();\u000a\u000a\u000a\u000aceleri.parse(process.argv);\u000a\u000a\u000a```\u000a\u000aHere's what you get:\u000a\u000a![Alt command line](http://i.imgur.com/g7ywq.png)\u000a\u000a\u000a","readmeFilename":"README.md","_id":"celeri@0.3.3","dist":{"shasum":"d0538137ddbdb6960884b0ef0f838aac1d34ee3a","tarball":"http://registry.npmjs.org/celeri/-/celeri-0.3.3.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"architectd","email":"craig.j.condon@gmail.com"},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"}]}
41 error new={"name":"celeri","description":"CLI lib","version":"0.3.3","author":{"name":"Craig Condon"},"repository":{"type":"git","url":"http://github.com/crcn/celeri.git"},"directories":{"lib":"./lib"},"dependencies":{"colors":"0.5.x","disposable":"0.0.x","outcome":"0.0.x","structr":"0.2.x","underscore":"1.2.x","tq":"0.0.x","crema":"0.1.x","beanpoll":"0.2.x","plugin":"0.3.x","keypress":"0.1.x","dsync":"0.0.x"},"main":"./lib/index.js","readme":"### C-e-L-er-I\u000a\u000a![Alt command line](http://i.imgur.com/DA77U.png)\u000a\u000a### Features:\u000a\u000a- History (up/down arrows)\u000a- Progress Bar\u000a- Loading/busy spinner\u000a- Password input\u000a- Confirmation \u000a- Prompt\u000a- Parse command line args\u000a- help menu, and sub help menu\u000a- Multi-line tables\u000a- Build flexible commands via [beanpole](https://github.com/spiceapps/beanpole)\u000a - OR statement \u000a - Middleware\u000a - Parameters \u000a- Trees\u000a- *Exposing Javascript*, and calling it from the command line - inspired by mongo's CLI utilitiy\u000a\u000a### To Do:\u000a\u000a- Help menu api\u000a- Title View \u000a- Custom colors for each view (input, loader, progress, table, etc.): exports.colors = {}\u000a- Error handling (display of command not found)\u000a- Add transports instead of depending on native stdin/stdout\u000a - Ability to use online\u000a\u000a\u000a\u000a## Usage:\u000a\u000a\u000a### .option(cmdOrOps, descOrCallback, callback)\u000a\u000aListens for a key (enter, up, left, backspace, etc.), or command. See [beanpole](https://github.com/spiceapps/beanpole) for documentation.\u000a\u000a#### Hello World: \u000a\u000a```javascript\u000a\u000avar celeri = require('celeri');\u000a\u000a//an option with info for the help menu\u000aceleri.option({\u000a command: 'hello :person',\u000a description: 'Prints \"hello [person]!\"',\u000a optional: {\u000a '--age': 'The person\\'s age',\u000a '--gender': 'The person\\'s gender'\u000a }\u000a}, function(data) {\u000a\u000a console.log(\"Hello %s!\", data.person);\u000a \u000a if(data.age) console.log(\"%s is %d years old.\", data.person, data.age); \u000a if(data.gender) console.log(\"%s is a %s.\", data.person, data.gender); \u000a\u000a});\u000a\u000a//parse the command line args\u000aceleri.parse(process.argv);\u000a\u000a```\u000a\u000aInteractive in terminal:\u000a \u000a```\u000a# node ./cmd ↩\u000a> hello craig ↩\u000ahello craig!\u000a```\u000a\u000apassed as arguments:\u000a\u000a```\u000a# node ./hello hello craig --age=21 --gender=cat ↩\u000ahello craig!\u000acraig is 21 years old.\u000acraig is a cat.\u000a```\u000a\u000aHelp menu:\u000a\u000a```\u000a# node ./cmd help ↩\u000a\u000aUsage: [command] --arg=value --arg2\u000a\u000aHelp:\u000a help Show help menu\u000a [cmd] help Show command help menu\u000a\u000aCommands:\u000a hello Prints \"hello [person]!\"\"\u000a\u000a```\u000a\u000aCommand Specific help menu:\u000a\u000a```\u000a# node ./cmd hello help ↩\u000a\u000aPrints \"hello [person]!\"\"\u000a\u000aUsage: hello [person]\u000a\u000aOptional Flags: \u000a --age The person's age\u000a --gender The person's gender\u000a```\u000a\u000a\u000a\u000a### .usage(value)\u000a\u000aSets the help menu usage text\u000a\u000a```javascript\u000aceleri.usage('[command] --arg=value');\u000a```\u000a\u000a\u000a#### \"OR\" statement:\u000a\u000a```javascript\u000a\u000a\u000aceleri.option('hello :name OR hi :name', 'some description', function(data)\u000a{\u000a\u0009console.log('Hello ' + data.name +'!');\u000a}).\u000aoption('set address :zip OR set address :city :state :zip', function(data)\u000a{\u000a\u0009console.log(\"City: %s, State: %s, Zip: %s \", data.city || 'None provided', data.state || 'None provided', data.zip);\u000a});\u000a\u000a```\u000a\u000a### .onJs(api)\u000a\u000aYou can easily expose javascript functions by providing an object:\u000a\u000a```javascript\u000a\u000a\u000avar api = {\u000a sayHello: function(name) {\u000a console.log(\"hello %s!\", name || 'craig');\u000a }\u000a}\u000a\u000aceleri.onJs({ api: api });\u000a\u000a```\u000a\u000aIn terminal:\u000a \u000a node ./hello ↩\u000a > api.sayHello(\"john\"); ↩\u000a hello john!\u000a\u000a### .progress(label, percent)\u000a\u000a```javascript\u000a\u000avar i = 0;\u000a\u000avar interval = setInterval(function()\u000a{\u000a\u0009celeri.progress('Label: ', i++);\u000a\u0009\u000a\u0009if(i == 100) clearInterval(interval);\u000a}, 10);\u000a\u000a```\u000a\u000a### .loading(label)\u000a\u000a```javascript\u000a\u000avar spinner = celeri.loading('Processing: ');\u000a\u000asetTimeout(function()\u000a{\u000a\u0009spinner.done(true);//undefined = done, true = success, false = fail\u000a}, 1000);\u000a\u000a````\u000a\u000a### .prompt(label, callback)\u000a\u000a```javascript\u000a\u000aceleri.prompt('Username: ', function(input)\u000a{\u000a\u0009\u000a});\u000a\u000a````\u000a\u000a### .confirm(message, callback)\u000a\u000a```javascript\u000a\u000aceleri.confirm(\"Do you want to continue?\", function(yes)\u000a{\u000a\u0009if(yes)\u000a\u0009{\u000a\u0009\u0009//continue\u000a\u0009}\u000a});\u000a\u000a```\u000a\u000a### .password(label[, mask], callback)\u000a\u000a```javascript\u000a\u0009\u000a//mask = *\u000aceleri.password('Password: ', '*', function(input)\u000a{\u000a\u0009//password\u000a});\u000a\u000a//no mask\u000aceleri.password('Password: ', function(input)\u000a{\u000a\u0009//password\u000a});\u000a\u000a```\u000a\u000a### .auth(callback)\u000a\u000a```javascript\u000a\u000aceleri.auth(function(user, pass)\u000a{\u000a\u0009//auth here\u000a});\u000a\u000a```\u000a\u000a\u000a### .drawTable(objects, ops)\u000a\u000a```javascript\u000a\u000avar objects = [\u000a \u000a {\u000a name: 'Craig',\u000a age: 21,\u000a interests: 'Cooking, espresso, backpacking, coding'\u000a },\u000a \u000a \u000a {\u000a name: 'Tim',\u000a age: 21,\u000a interests: 'Design, Traveling, Photography'\u000a \u000a }\u000a\u000a];\u000a\u000aceleri.drawTable(objects, {\u000a columns: ['name','age','interests']\u000a});\u000a\u000a\u000a``` \u000a\u000a\u000aGives you something like:\u000a\u000a\u000a![Alt command line](http://i.imgur.com/oUtC9.png)\u000a\u000a\u000aHere's a multi-line table:\u000a\u000a\u000a![Alt command line](http://i.imgur.com/O5o47.png) \u000a\u000a### .drawTree(tree) \u000a\u000aDraws a tree\u000a\u000a````javascript\u000a \u000a//print out the contents of the celeri object\u000aceleri.drawTree(celeri); \u000a\u000a````\u000a\u000aHere's another example:\u000a\u000a![Alt command line](http://i.imgur.com/4F0e0.png)\u000a\u000a\u000a### Let's kick it up a notch\u000a\u000a\u000a```javascript\u000a\u000avar celeri = require('../lib');\u000a\u000a\u000avar credentials;\u000a\u000a\u000a \u000aceleri.option('login OR login :user :pass', function(data)\u000a{\u000a \u000a //reference to the current request\u000a var self = this;\u000a \u000a\u000a //called after auth credentials have been entered in\u000a function onAuth(creds)\u000a {\u000a\u000a //credits wrong? DO NOT CONTINUE\u000a if(creds.user != 'user' || creds.pass != 'pass')\u000a {\u000a return console.log(\"Incorrect user / pass\".red);\u000a }\u000a \u000a //otherwise, add the user to the CURRENT request so it can be passed\u000a //onto the next route listener\u000a self.user = creds.user;\u000a \u000a //cache the credentials so the user doesn't have to login each time\u000a credentials = creds;\u000a \u000a //not another listener? display a success response\u000a if(!self.next()) console.log(\"Logged in as %s\", creds.user.green);\u000a }\u000a \u000a \u000a //user already logged in? pass!\u000a if(credentials)\u000a {\u000a onAuth(credentials);\u000a }\u000a \u000a //otherwise check if the user is passed in the route\u000a else\u000a if(data.user && data.pass)\u000a {\u000a onAuth(data);\u000a }\u000a \u000a //or prompt for authentication\u000a else\u000a {\u000a celeri.auth(function(user, pass)\u000a {\u000a onAuth({ user: user, pass: pass });\u000a });\u000a }\u000a});\u000a\u000a\u000a\u000a/**\u000a * This stuff's private. The user has to be authenticated *before* this command is executed\u000a */\u000a \u000aceleri.option('login -> account', function()\u000a{\u000a console.log('Here\\'s your account info %s!', this.user.green);\u000a});\u000a\u000aceleri.open();\u000a\u000a\u000a\u000aceleri.parse(process.argv);\u000a\u000a\u000a```\u000a\u000aHere's what you get:\u000a\u000a![Alt command line](http://i.imgur.com/g7ywq.png)\u000a\u000a\u000a","readmeFilename":"README.md","gitHead":"9524ec5fd8a11ba3864c95370250b39cb8cda721","bugs":{"url":"https://github.com/crcn/celeri/issues"},"homepage":"https://github.com/crcn/celeri","_id":"celeri@0.3.3","scripts":{},"_shasum":"c928976294fa87db395b17f9ff4bc02c7073877e","_from":".","_npmVersion":"1.4.24","_npmUser":{"name":"architectd","email":"craig.j.condon@gmail.com"},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"}],"dist":{"shasum":"c928976294fa87db395b17f9ff4bc02c7073877e","tarball":"http://registry.npmjs.org/celeri/-/celeri-0.3.3.tgz"}}: celeri
41 error at RegClient.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:300:14)
41 error at Request._callback (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:238:65)
41 error at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/request.js:123:22)
41 error at Request.emit (events.js:98:17)
41 error at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:893:14)
41 error at Request.emit (events.js:117:20)
41 error at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:844:12)
41 error at IncomingMessage.emit (events.js:117:20)
41 error at _stream_readable.js:938:16
41 error at process._tickCallback (node.js:419:13)
42 error If you need help, you may report this *entire* log,
42 error including the npm and node versions, at:
42 error <http://github.com/npm/npm/issues>
43 error System Darwin 13.3.0
44 error command "node" "/usr/local/bin/npm" "publish"
45 error cwd /Users/craig/Developer/Public/celeri
46 error node -v v0.10.30
47 error npm -v 1.4.24
48 verbose exit [ 1, true ]