-
Notifications
You must be signed in to change notification settings - Fork 172
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
How to get input from the terminal #603
Comments
I'm working on some better documentation 😅 There is So you can do: const buf = new Uint8Array(4096);
const nread = await tjs.stdin.read(buf);
console.log(new TextDecoder().decode(buf.subarray(0, nread))); The API is pull-based, rather than event based. |
Thanks for the quick reply, this does work, but it is not compatible with the nodejs API. If I want to implement a general library, I have to do a separate process for txiki. |
That is correct and by design. txiki.js does not aim to implement the Nodejs API. |
A simple polyfill
|
I want to use txiki to run some terminal programs and need to be able to get user input. The simplest demo is as follows, but it seems that txiki does not have a process module, or other interfaces that can get user input?
The link in this issue is no longer valid. #404
The text was updated successfully, but these errors were encountered: