|
|
|
|
|
|
|
|
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) |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |