Originally published at recca0120.github.io One day I was spawning a CLI from Node (the Claude CLI, which dumps a lot of JSON) and piping its stdout back to parse. Short outputs were fine. But the moment output grew past a few hundred KB, the last few KB just disappeared β JSON.parse blew up on the final line, and the truncation point shifted run to run. After digging through Node's official issues, Linux pipe docs, and community deep-dives, the verdict is blunt: this is a known Node behavior since 2015, and the only reliable pure-stdlib fix is writing to a temp file. This post lays out the trade-offs across six approaches so you don't have to repeat the journey. The Symptom import { spawn } from ' node:child_process ' ; const child = spawn ( ' some-cli ' , [ ' --big-output ' ]); let buf = '' ; child . stdout . on ( ' data ' , ( chunk ) => { buf += chunk ; }); child . on ( ' close ' , () => { JSON .β¦