API DOCS には記載されていないが、fs.createWriteStream()
の options に fd を渡すことができる。その際 path には null
でも渡しておけばよい。
fs.createWriteStream(null, {fd: 1});
node/fs.js at 8d045a30e95602b443eb259a5021d33feb4df079 · joyent/node
// lib/fs.js
this.fd = options.hasOwnProperty('fd') ? options.fd : null;