Questions tagged [inquirer]
77 questions
14
votes
4 answers
Is there a way to use previous answers in inquirer when presenting a prompt (inquirer v6)?
So what I want to do is use a previous answer when asking a question further down the line. Basically so that I can show a summary of what will be created and ask for a verification.
this.prompt([
{
type: 'input',
name: 'name',
…

Ari Shaposhnik
- 141
- 1
- 1
- 3
7
votes
2 answers
How do I dynamically add questions to Inquirer JS during execution, using rxjs?
I want to ask questions to the user without having all the questions lined up immediately.
The documentation mentions rxjs but I feel there is a gap in the documentation on how to properly add questions while prompts are being executed, or at least…

William Bernting
- 561
- 4
- 15
7
votes
1 answer
How to terminate npm inquirer prompt and return control to main menu/function
I keep running into an issue with the inquirer npm package and cant find a solution anywhere. I am trying to allow a user to exit the inquirer prompt in a function at any point and return to the main menu. However, it seems this is causing multiple…

Alex-Preissler
- 71
- 1
- 5
5
votes
2 answers
How to clear wrong input in Inquirer.js
const inquirer = require("inquirer")
var questions = [
{
type: "number",
name: "name",
message: "Please the number of players",
validate: function (name) {
var valid = Number.isInteger(name)
return valid || `Please…

Shah
- 75
- 1
- 5
5
votes
1 answer
How to set default value for an answer using inquirer?
I am trying to create a small build script which will ask the user for the location to the mysql headers if they are not found in the default path. Right now I am using inquirer to prompt the user for input which works fine, but I have encountered…

Cyclonecode
- 29,115
- 11
- 72
- 93
4
votes
1 answer
What is the difference between 'List' and 'Rawlist' when using Inquirer
I'm using inquirer and I can either make a 'list' type or a 'rawlist' type.
My goal is to allow the user to select an item from an array of products from a sql database, but I am now curious what the difference between these two list types are? In…

J.Whittington
- 47
- 1
- 6
3
votes
3 answers
how to call another page function name in inquirer node js
I am making a CLI using inquirer in nodejs.
So in Every choice list I have to give Exit choice so if user want to exit he/she can easily Exit.
So I have to write Exit again and again to avoid that problem I made a Exit.js file and move Exit code…
user16041868
3
votes
1 answer
How to test inquirer validation
I have already seen the question and answer on How to write unit tests for Inquirer.js?
I want to test that my validation is correct. So for example, if I have:
const answer = await inquirer.prompt({
name: 'answer',
message: 'are you sure?'
…

Kousha
- 32,871
- 51
- 172
- 296
2
votes
0 answers
Passing information from inquirer prompt to another function? Node.js
Just getting back to coding and doing some practice on some fun code I came across from a friend.
I am using inquirer to ask the user what attack they would like to use. I then want to pass that information into another function.
I am having trouble…

Harley
- 53
- 1
- 6
2
votes
0 answers
i can't select any item on my terminal using inquirer python
the cursor is not moving and i can just press enter in terminal
i want to create a menu in my terminal and i want to select items by pressing up and down.
i used inquirer and console-menu.
even when i use this inquirer documentation example of…

Mmd Arghavani
- 21
- 1
2
votes
0 answers
Inquirer List Selection on Windows in Console
I have a working python app that I created to automate a process for work. Essentially what the program does is provide an authorization number to a user from a list of numbers, after the user specifies how many they need and for what region. The…

Nick Gardner
- 59
- 6
2
votes
2 answers
Is there a way to use the answers entered by the user in python? (using inquirer)
python beginner here.
I'm trying to create a script that recursively renames files in a folder according to set rules (no spaces, numbers, no special characters...).
For that, I ask the user, by choosing in a list (all using inquirer) how they wants…

ALuTHIPA
- 29
- 4
2
votes
1 answer
How can I auto answer questions in inquirer.js?
I'm writing a small CLI in typescript and I have a command which basically allows me to generate a json file with default values in it (just like npm init -y), but I don't know how to auto answer the questions in inquirer.
This is what I've got so…

kmp
- 692
- 6
- 17
2
votes
1 answer
ORA Spinner stops on CLI with Inquirer.js
Don't know what to title the question but I will try my best to convey in the rest of the question.
I am developing a CLI which first prompt user for a few questions and clone a repository based on the answers.
Example:
Frontend Framework:
[x] Vue
[…

Muhaddis
- 530
- 7
- 18
2
votes
3 answers
Import Inquirer as module in Node 13
I'm having troubles with import of Inquirer using modules in Node 13.12.0. Any other import works well. As long as I've been using Node 12.x with require() it worked well.
My use-case of anything.mjs
import fs from "fs"; // works well
import…

Jax-p
- 7,225
- 4
- 28
- 58