Socket
Socket
Sign inDemoInstall

inquirer

Package Overview
Dependencies
Maintainers
2
Versions
179
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inquirer - npm Package Compare versions

Comparing version 4.0.2 to 5.0.0

2

lib/inquirer.js

@@ -72,3 +72,3 @@ 'use strict';

* Public CLI helper interface
* @param {Array|Object|rx.Observable} questions - Questions settings array
* @param {Array|Object|Rx.Observable} questions - Questions settings array
* @param {Function} cb - Callback being passed the user answers

@@ -75,0 +75,0 @@ * @return {inquirer.ui.Prompt}

@@ -10,3 +10,3 @@ 'use strict';

var observe = require('../utils/events');
var rx = require('rx-lite-aggregates');
var Rx = require('rxjs/Rx');

@@ -23,3 +23,3 @@ class EditorPrompt extends Base {

this.editorResult = new rx.Subject();
this.editorResult = new Rx.Subject();

@@ -80,5 +80,5 @@ // Open Editor on "line" (Enter Key)

if (error) {
this.editorResult.onError(error);
this.editorResult.error(error);
} else {
this.editorResult.onNext(result);
this.editorResult.next(result);
}

@@ -88,3 +88,3 @@ }

onEnd(state) {
this.editorResult.dispose();
this.editorResult.unsubscribe();
this.lineSubscription.dispose();

@@ -91,0 +91,0 @@ this.answer = state.value;

'use strict';
var _ = require('lodash');
var rx = require('rx-lite-aggregates');
var Rx = require('rxjs/Rx');
var runAsync = require('run-async');

@@ -30,3 +30,3 @@ var utils = require('../utils/utils');

// be using the exact same object in memory.
var obs = _.isArray(questions) ? rx.Observable.from(questions) : questions;
var obs = _.isArray(questions) ? Rx.Observable.from(questions) : questions;

@@ -61,4 +61,4 @@ this.process = obs

question = _.clone(question);
return rx.Observable.defer(() => {
var obs = rx.Observable.of(question);
return Rx.Observable.defer(() => {
var obs = Rx.Observable.of(question);

@@ -84,4 +84,4 @@ return obs

this.activePrompt = new Prompt(question, this.rl, this.answers);
return rx.Observable.defer(() =>
rx.Observable.fromPromise(
return Rx.Observable.defer(() =>
Rx.Observable.fromPromise(
this.activePrompt.run().then(answer => ({ name: question.name, answer: answer }))

@@ -97,3 +97,3 @@ )

}
return rx.Observable.defer(() => rx.Observable.return(question));
return Rx.Observable.defer(() => Rx.Observable.of(question));
}

@@ -103,12 +103,12 @@

if (question.when === false) {
return rx.Observable.empty();
return Rx.Observable.empty();
}
if (!_.isFunction(question.when)) {
return rx.Observable.return(question);
return Rx.Observable.of(question);
}
var answers = this.answers;
return rx.Observable.defer(() =>
rx.Observable.fromPromise(
return Rx.Observable.defer(() =>
Rx.Observable.fromPromise(
runAsync(question.when)(answers).then(shouldRun => {

@@ -115,0 +115,0 @@ if (shouldRun) {

'use strict';
var rx = require('rx-lite-aggregates');
var Rx = require('rxjs/Rx');

@@ -9,3 +9,3 @@ function normalizeKeypressEvents(value, key) {

module.exports = function(rl) {
var keypress = rx.Observable.fromEvent(rl.input, 'keypress', normalizeKeypressEvents)
var keypress = Rx.Observable.fromEvent(rl.input, 'keypress', normalizeKeypressEvents)
// Ignore `enter` key. On the readline, we only care about the `line` event.

@@ -15,3 +15,3 @@ .filter(({ key }) => key.name !== 'enter' && key.name !== 'return');

return {
line: rx.Observable.fromEvent(rl, 'line'),
line: Rx.Observable.fromEvent(rl, 'line'),
keypress: keypress,

@@ -18,0 +18,0 @@

'use strict';
var _ = require('lodash');
var rx = require('rx-lite-aggregates');
var Rx = require('rxjs/Rx');
var runAsync = require('run-async');

@@ -12,3 +12,3 @@

* @param {Object} answers - Answers object
* @return {rx.Obsersable} - Observable emitting once value is known
* @return {Rx.Observable} - Observable emitting once value is known
*/

@@ -18,6 +18,6 @@

if (!_.isFunction(question[prop])) {
return rx.Observable.return(question);
return Rx.Observable.of(question);
}
return rx.Observable.fromPromise(
return Rx.Observable.fromPromise(
runAsync(question[prop])(answers).then(value => {

@@ -24,0 +24,0 @@ question[prop] = value;

{
"name": "inquirer",
"version": "4.0.2",
"version": "5.0.0",
"description":

@@ -49,4 +49,3 @@ "A collection of common interactive command line user interfaces.",

"run-async": "^2.2.0",
"rx-lite": "^4.0.8",
"rx-lite-aggregates": "^4.0.8",
"rxjs": "^5.5.2",
"string-width": "^2.1.0",

@@ -53,0 +52,0 @@ "strip-ansi": "^4.0.0",

@@ -289,3 +289,3 @@ Inquirer.js

Internally, Inquirer uses the [JS reactive extension](https://github.com/Reactive-Extensions/RxJS) to handle events and async flows.
Internally, Inquirer uses the [JS reactive extension](https://github.com/ReactiveX/rxjs) to handle events and async flows.

@@ -299,7 +299,7 @@ This mean you can take advantage of this feature to provide more advanced flows. For example, you can dynamically add questions to be asked:

// At some point in the future, push new questions
prompts.onNext({ /* question... */ });
prompts.onNext({ /* question... */ });
prompts.next({ /* question... */ });
prompts.next({ /* question... */ });
// When you're done
prompts.onCompleted();
prompts.complete();
```

@@ -306,0 +306,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc