Comparing version 1.0.0 to 1.0.1
@@ -39,3 +39,2 @@ /** | ||
this.firstRender = true; | ||
this.pointer = 0; | ||
@@ -89,3 +88,3 @@ | ||
if (this.firstRender) { | ||
if (!this.spaceKeyPressed) { | ||
message += '(Press <space> to select)'; | ||
@@ -107,4 +106,2 @@ } | ||
this.firstRender = false; | ||
this.screen.render(message, bottomContent); | ||
@@ -162,2 +159,3 @@ }; | ||
Prompt.prototype.onSpaceKey = function () { | ||
this.spaceKeyPressed = true; | ||
this.toggleChoice(this.pointer); | ||
@@ -164,0 +162,0 @@ this.render(); |
'use strict'; | ||
var _ = require('lodash'); | ||
var readlineFacade = require('readline2'); | ||
var MuteStream = require('mute-stream'); | ||
var readline = require('readline'); | ||
@@ -13,5 +14,3 @@ /** | ||
if (!this.rl) { | ||
this.rl = readlineFacade.createInterface(_.extend({ | ||
terminal: true | ||
}, opt)); | ||
this.rl = readline.createInterface(setupReadlineOptions(opt)); | ||
} | ||
@@ -54,1 +53,17 @@ this.rl.resume(); | ||
}; | ||
function setupReadlineOptions(opt) { | ||
opt = opt || {}; | ||
// Default `input` to stdin | ||
opt.input = opt.input || process.stdin; | ||
// Add mute capabilities to the output | ||
var ms = new MuteStream(); | ||
ms.pipe(opt.output || process.stdout); | ||
opt.output = ms; | ||
return _.extend({ | ||
terminal: true | ||
}, opt); | ||
} |
@@ -61,2 +61,3 @@ 'use strict'; | ||
PromptUI.prototype.processQuestion = function (question) { | ||
question = _.clone(question); | ||
return rx.Observable.defer(function () { | ||
@@ -63,0 +64,0 @@ var obs = rx.Observable.of(question); |
@@ -116,3 +116,3 @@ 'use strict'; | ||
var regex = new RegExp( | ||
'(?:(?:\\033\[[0-9;]*m)*.?){1,' + width + '}', | ||
'(?:(?:\\033[[0-9;]*m)*.?){1,' + width + '}', | ||
'g' | ||
@@ -119,0 +119,0 @@ ); |
{ | ||
"name": "inquirer", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A collection of common interactive command line user interfaces.", | ||
@@ -31,4 +31,4 @@ "author": "Simon Boudrias <admin@simonboudrias.com>", | ||
"lodash": "^4.3.0", | ||
"mute-stream": "0.0.6", | ||
"pinkie-promise": "^2.0.0", | ||
"readline2": "^1.0.1", | ||
"run-async": "^2.2.0", | ||
@@ -44,3 +44,3 @@ "rx": "^4.1.0", | ||
"eslint": "^2.1.0", | ||
"eslint-config-xo-space": "^0.11.0", | ||
"eslint-config-xo-space": "^0.12.0", | ||
"gulp": "^3.9.0", | ||
@@ -47,0 +47,0 @@ "gulp-coveralls": "^0.1.0", |
@@ -22,3 +22,3 @@ Inquirer.js | ||
> **Note:** **`Inquirer.js`** provides the user interface, and the inquiry session flow. If you're searching for a full blown command line program utility, then check out [Commander.js](https://github.com/visionmedia/commander.js) or [Vorpal.js](https://github.com/dthree/vorpal). | ||
> **Note:** **`Inquirer.js`** provides the user interface and the inquiry session flow. If you're searching for a full blown command line program utility, then check out [Commander.js](https://github.com/visionmedia/commander.js) or [Vorpal.js](https://github.com/dthree/vorpal). | ||
@@ -43,3 +43,3 @@ | ||
### Examples (Run it and see it) | ||
Checkout the `examples/` folder for code and interface examples. | ||
Check out the `examples/` folder for code and interface examples. | ||
@@ -46,0 +46,0 @@ ``` shell |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62799
1694
+ Addedmute-stream@0.0.6
+ Addedmute-stream@0.0.6(transitive)
- Removedreadline2@^1.0.1
- Removedmute-stream@0.0.5(transitive)
- Removedreadline2@1.0.1(transitive)