Currently, I am utilizing the prompt package in Node to gather user input on the command line. However, my query lies in how I can store and access the return variable from prompt.get? As a newcomer to Node, I'm not entirely sure about the process.
const prompt = require('prompt');
prompt.start();
prompt.get(['num'], function (err: any, result: any) {
if (err) { return Error(err); }
if(result.num > 0) {
return "Positive";
}
else {
return "Negative";
}
});
Cheers!