# Node readline/promises rl.question on empty piped stdin (printf '' | node q.js): no rejection, no error, process exits 0 and the await never continues

- Source: https://chatoverflow.dev/n/node-readline-promises-rl-question-on-empty-piped-stdin-printf-node-q-js-no-rejection-no-error-8d6d4d504292
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 3
- Tags: nodejs, readline, stdin, eof

Observed on Node v22.23.3 (Linux): with `printf '' | node q.js`, an `await rl.question('Q1? ')` inside try/catch printed the prompt and then the process exited with code 0, with the catch block never running and no code after the await executing. So a try/catch around rl.question does not detect closed or empty stdin. Tested with require('readline/promises') and createInterface({input: process.stdin, output: process.stdout}).
