Questions tagged [inquirer]
77 questions
1
vote
2 answers
How to get my "if else" statements to work properly in this Node file using Inquirer?
I'm trying to get some code to have a certain message to appear on the screen depending on what answer they give on a question. This is a node application that is using the Inquirer package and every-time that I run the node application, it comes…

wtsegars
- 93
- 3
- 15
1
vote
1 answer
inquirer package, present questions based on previous answers
I'm using NPM 'inquirer' package in order to present the user various questions. One of them is a 'choices' selection.
Is there a way to present follow up questions based on the 'choices' selection?
Here's my code:
const { prompt } =…

David Faizulaev
- 4,651
- 21
- 74
- 124
1
vote
2 answers
How can i replace an array element multiple times?
console.log("Start file 1 =========================================");
function Letter (letter) {
this.letter = letter;
this.guess = false;
this.answer = function () {
if (!this.guess) {
return "_";
}
…
user10209332
1
vote
0 answers
Inquirer.js: ask multiple questions if one prompt is true
I'm writing an account creator using Inquirer.js, and wanted to ask for the user's e-mail and password only if the user asked for such protection. It goes like this:
inquirer.prompt([
{type:'input', name:'username', message:'Choose an…

Salies
- 21
- 5
1
vote
1 answer
".then is not a function" from a very simple inquirer program
the very simple example below (pretty much copied off the npm inquirer front page) is giving the ".then is not a function" error. However I can't figure out what the issue is.
var inquirer = require('inquirer');
inquirer.prompt([
{
…

P Burke
- 1,630
- 2
- 17
- 31
1
vote
1 answer
keep inquirer process alive when called from node shebang
I have a function like this:
const runInteractive = (rows, dups) => {
const keys = new Set(dups);
const questions = _(rows)
.filter(row => keys.has(row.key))
.groupBy(row => row.key)
.map((rows, key) => ({
type: 'list',
…

dagda1
- 26,856
- 59
- 237
- 450
1
vote
2 answers
Close Vorpal instance programmatically
This regards the vorpal CLI for node.js, like so:
const vorpal = require('vorpal')();
The user can close vorpal with Ctrl-C, but how can I close vorpal programmatically?
For example, if a vorpal terminal session is opened, but no further stdin is…

Alexander Mills
- 90,741
- 139
- 482
- 817
0
votes
0 answers
is there any method to take input from users and store it in array using inquirer in typescript?
I am trying to take input from users using npm inquirer like student info data and want to store it in array.
Language TYPESCRIPT
i am trying to build student registration form in typescript
I am using inquirer npm package for taking user's…
0
votes
0 answers
Trying to use a promisified function to insert values into an inquirer choices field
I set up the promise function via:
const mysql = require('mysql2');
const util = require('util');
require('dotenv').config();
const db = mysql.createConnection(
{
host: 'localhost',
user: process.env.DB_USER,
password:…

DSwecker
- 1
- 2
0
votes
0 answers
How to run inquirer.prompt on every occurance of element using cheerio library?
I'm currently developing the console application which allows users to change the values inside HTML files. I'm using the cheerio library to find in the HTML file every occurrence of the class called "dynamic" and next I want the user to assign a…

Jabli
- 31
- 4
0
votes
1 answer
MYSQL results for inquirer prompt
I am trying ti use the results of a MySQL query to populate the choices of a inquirer prompt am having trouble getting the query results out into a variable.
I have the following in my code for a switch wit multiple actions that can be done to…

cwen13
- 1
0
votes
2 answers
How do properly chain these .then statements so they resolve in the correct order?
The assignment I'm working on is to design a Node.js program that presents the user with command line prompts and writes a well-organized README markdown file with the input. The prompts are created with the Inquirer NPM. The code starts with the…

Sam Tomaka
- 23
- 5
0
votes
0 answers
Inquirer horizontal select
is it possible to display select prompt horizontally with Inquirer? I'd like to implement button bar with keyboard support (arrows).
[Yes] [No] [Abort]
I reviewed all examples and source code of select package but I didn't found any trace of such a…

Kragh
- 170
- 1
- 13
0
votes
1 answer
Trying to goto second inquirer prompt depending on user selection
Bootcamp student here. I am trying to generate a team profile together. Upon the manager information input, I am able to decide whether I want to add whether an engineer, intern, or no further entry. However, when I select the Engineer option, the…

joonkidk
- 31
- 4
0
votes
1 answer
How to prompt a free type question with list of options in python inquirer?
I'm looking for something like this:
[?] Question:
> 1
2
3
So the user's answer wont be limited to 1, 2 or 3. But inquirer only lets me do either List or Text. List doesn't allow free type, Text has no…

Killjoyer
- 5
- 2