MCPcopy
hub / github.com/codeaashu/claude-code / handleEPIPE

Function handleEPIPE

src/utils/process.ts:1–9  ·  view source on GitHub ↗
(
  stream: NodeJS.WriteStream,
)

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 1

destroyMethod · 0.45

Tested by

no test coverage detected