nodejsscript • Docs
nodejsscript / s / read
read(
options
):Promise
<ShellString
>
This function mimic read
command.
So, the function purpose is reading from stdin
.
const answer= await $.read({ "-p": "Question" });
const color= await $.read({ "-p": "Your color", completions: [ "red", "green" ] });
if($.isFIFO(0)) await $.read().then(echo.bind(null, "E.g. for reading received input:"));
• options: ReadOptions
Promise
<ShellString
>