Performance: process.stdin and process.stdout
MEDIUM IMPACT
This concept affects input/output responsiveness and event loop blocking in Node.js applications, impacting how fast the app can process user input and produce output.
process.stdout.write('Enter data: '); process.stdin.on('data', (chunk) => { console.log(`You typed: ${chunk.toString()}`); }); process.stdin.resume();
const output = process.stdout.write('Enter data: '); const input = process.stdin.read(); // Blocking read without event listeners
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Blocking synchronous read on process.stdin | N/A | N/A | N/A | [X] Bad |
| Asynchronous event-driven input handling | N/A | N/A | N/A | [OK] Good |