-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std/node: add readline module #5387
Comments
Hello @EvanHahn @bartlomieju I want to work on this issue. How can I proceed with this? |
I'll defer to @bartlomieju on this one as I'm not a Deno maintainer. I recently put up a pull request for Again, I'm not a maintainer, but maybe that info will help. |
Hi, I wrote this code with Deno.stdin in mind. const decoder = new TextDecoder();
export async function readLine() {
let stringInput = '';
while (true) {
const buffer = new Uint8Array(1);
const readStatus = await Deno.stdin.read(buffer);
// Found EOL
if (readStatus == null) {
break;
}
const char = decoder.decode(buffer);
// On Enter, exit
if (char === '\n') {
break;
}
stringInput += char;
}
return stringInput;
} Credit to @lucacasonato #3614 (comment) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
For completeness, we should add a polyfill for Node's readline module.
The text was updated successfully, but these errors were encountered: