Bläddra i källkod

exception in prompts

production
pb 3 år sedan
förälder
incheckning
7ffb88dd35
1 ändrade filer med 8 tillägg och 3 borttagningar
  1. 8
    3
      cliverse.js

+ 8
- 3
cliverse.js Visa fil

const clii = readline.createInterface({ input: process.stdin, output: process.stdout }); const clii = readline.createInterface({ input: process.stdin, output: process.stdout });
return new Promise((resolve, reject)=>{ return new Promise((resolve, reject)=>{
clii.question(q, (answer)=>{ clii.question(q, (answer)=>{
clii.close();
console.log("resolve is being called");
resolve(answer)
try {
clii.close();
console.log("readline.createInterface closed");
resolve(answer)
}
catch(e) {
reject(e)
}
}) })
}) })
} }

Laddar…
Avbryt
Spara