Questions tagged [inquirer]

77 questions
0
votes
1 answer

Text in Bash terminal getting overwritten! Using JS, Node.js (npms are: inquirer, console.table, and mysql)

Short 10sec video of what is happening: https://drive.google.com/file/d/1YZccegry36sZIPxTawGjaQ4Sexw5zGpZ/view I have a CLI app that asks a user for a selection, then returns a response from a mysql database. The CLI app is run in node.js and…
0
votes
1 answer

Inquirer.prompt exiting without an answer

I was wondering if anybody could help me out with an explanation as to why the below code would cause the command line to exit without waiting for an answer from the user. init(); function init() { loadPrompts(); } async function loadPrompts() { …
0
votes
1 answer

It is possible to create branching questions with inquirer?

const employeeQuestion = [ { type: "list", name: "employeeTitle", message: "What's the employee's title", choices: ["Engineer", "Intern"] }, //when role is engineer is true, ask this question { …
user79140
  • 3
  • 1
0
votes
0 answers

Accessing commands in Inquirer tool

I installed Inquirer package for a command prompt tool and wrote this simple prompt: function promptUser(): void { console.clear(); displayTodoList(); // harmless method. inquirer.prompt({ type: "list", name:…
user6051680
0
votes
1 answer

Executing a function at the end of the process

function initNpm (){ //services() const spawn_option ={ cwd:'./'+projet ,detached:true} var child = exec('npm init' , spawn_option,function (err, stdout, stderr){ if(err){console.log(err)} …
lokho
  • 1
  • 1
0
votes
0 answers

How to make inqurerjs work with async/await

I've got a function which uses inquirer to ask a series of questions and then calls a function in the inquirer.prompt(q).then() function with the answers. This works perfectly well but I'm trying to do some refactoring of my app and I want to be…
Alex Foxleigh
  • 1,784
  • 2
  • 21
  • 47
0
votes
1 answer

inquirer responses used in inserted to database with mysql

So I've done quite a bit of digging on this one but can't seem to get my variables to INSERT INTO my database. my goal is to allow the user to add an employee via inquirer npm My attempt: ).then(function ({ first_name, last_name, manager }) { …
AylaWinters
  • 1,121
  • 2
  • 7
  • 24
0
votes
1 answer

Removing commas from Array created with checkbox from Node Inquirer

I have the following inquirer prompt, which as far as I understands returns an array of strings: {name: "food", message:"choose your favorite ➝ ", type: "checkbox", choices: ["option1", "option2", "option3", "option4",…
M0llzilla
  • 33
  • 5
0
votes
2 answers

Nodejs: question of type input with npm inquirer not working

I am using npm inquirer for the first time. I am using a code similar to this: const inquirer = require("inquirer"); const questions = [ { type: "checkbox", name: "collections.telemetria", message: "Select collections of database…
EuberDeveloper
  • 874
  • 1
  • 14
  • 38
0
votes
0 answers

InquirerJS | "TypeError: Cannot read property 'then' of undefined" error when

I'm trying to run the InquirerJS example problem, as documented here: https://github.com/SBoudrias/Inquirer.js/blob/master/packages/inquirer/examples/pizza.js Unfortunately, when trying to do so, I get this TypeError. I'm running the file through my…
Homum
  • 21
  • 1
0
votes
2 answers

Python Print Parts Of Dictionaries

I'm writing some python using the module inquirer and it returns the results as a python dictionary, like this: {'Apps': ['Notes']} I was wondering if would be possible to just get the 'Notes' bit somehow? The code for the selection thing is below…
Alex Hawking
  • 1,125
  • 5
  • 19
  • 35
0
votes
1 answer

Return answer of inquirer prompt inside of another function

I have a function wherein I want to do some things with a class object selected by the user. I was thinking, I present them with some options, then after they select it, I use the string to identify the class object in an array of objects like so: …
Z-Man Jones
  • 187
  • 1
  • 12
0
votes
1 answer

Python Inquirer Module: Remove Choices When Done (Using Curses)

NOTE: Although I give a lot of info on Inquirer, I'm pretty sure that most of it won't apply (just being safe). For my actual question about curses, its at the bottom. I'm using the Inquirer module in Python 3 to allow the user to select a value…
Theo
  • 613
  • 4
  • 22
0
votes
1 answer

Pyinquirer not validating integer values

I´m using Py inquirer @ latest version. Python version is 3. I setup a test Programm. Just the basics and copy paste this from the project docu import inquirer questions = [ inquirer.Text('name', message="What's your name"), …
Exitare
  • 561
  • 2
  • 10
  • 30
0
votes
0 answers

Node.js Vorpal CLI - include subcommands as one command

Say we have this: vorpal.command('find [sumanOptions] [folder]') .description('find test files to run') .action(function (args: Array, cb: Function) { // args => {sumanOptions: 'a b c'} }); how can I pass a string of commands…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817