This modifies the TTYWrap constructor to add another argument specifying if it's a readable or writable TTY . That is stdin or stdout. If a TTYWrap is not readable then writes to it are blocking. This makes process.stdout blocking.