MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / handleEPIPE

Function handleEPIPE

source code/utils/process.ts:3–11  ·  view source on GitHub ↗
(
  stream: NodeJS.WriteStream,
)

Source from the content-addressed store, hash-verified

1// https://github.com/AnukarOP
2
3function handleEPIPE(
4 stream: NodeJS.WriteStream,
5): (err: NodeJS.ErrnoException) => void {
6 return (err: NodeJS.ErrnoException) => {
7 if (err.code === 'EPIPE') {
8 stream.destroy()
9 }
10 }
11}
12
13// Prevents memory leak when pipe is broken (e.g., `claude -p | head -1`)
14export function registerProcessOutputErrorHandlers(): void {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected