Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

170
Views
How to add User input suggestion using Readline or any Node JS native library?

Anyone know how to make suggestion input user using readline library from native node js like picture below? Suggestion can be replace by user input.

I want make command using one file js, not include external modules.

enter image description here

enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Would this work for you?

const readline = require('readline'),

rl = readline.createInterface(process.stdin, process.stdout);


const prompt = 'Project folder';
const suggestion = 'quasar-project';

rl.question(`? ${prompt}: >> ${suggestion} `, (answer) => {
  answer = answer || suggestion;
  rl.close();
  console.log(answer);
});
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!