()
| 13 | process.stdin.setEncoding('utf8'); |
| 14 | |
| 15 | const onReadable = () => { |
| 16 | let chunk; |
| 17 | while ((chunk = process.stdin.read()) !== null) { |
| 18 | if (totalSize + chunk.length > MAX_STDIN_SIZE) { |
| 19 | const remainingSize = MAX_STDIN_SIZE - totalSize; |
| 20 | data += chunk.slice(0, remainingSize); |
| 21 | console.warn( |
| 22 | `Warning: stdin input truncated to ${MAX_STDIN_SIZE} bytes.`, |
| 23 | ); |
| 24 | process.stdin.destroy(); // Stop reading further |
| 25 | break; |
| 26 | } |
| 27 | data += chunk; |
| 28 | totalSize += chunk.length; |
| 29 | } |
| 30 | }; |
| 31 | |
| 32 | const onEnd = () => { |
| 33 | cleanup(); |
nothing calls this directly
no outgoing calls
no test coverage detected