Doesnt work in repl
bonny5151 opened this issue · comments
bonny5151 commented
Doesnt work in node repl
Cyril Auburtin commented
Can you post a proper issue, with repro code, versions, platform infos? thanks
I maintain this repo for free, hope you understand
Cyril Auburtin commented
indeed it seems the behavior is not good from REPL
> const prompt = require('prompt');
undefined
> const v = await prompt.get({ properties: { weather: { type: 'string', enum: ['bad', 'good', 'decent'] } } })
prompt: weather: good
undefined
> good
Uncaught ReferenceError: good is not defined
compared to running a file (which is usually how people do)
const prompt = require('prompt');
(async() => {
const v = await prompt.get({ properties: { weather: { type: 'string', enum: ['bad', 'good', 'decent'] } } });
console.log(v);
})();
// outputs:
// prompt: weather: good
// { weather: 'good' }
bonny5151 commented
I did not research what the difference is, but i verified, the prompt-sync npm package does work in the repl. Look in their package for solutions