When you call fs.createReadStream , you can pass it in a file descriptor:
var fs = require('fs'); var fd = fs.openSync('/tmp/tmp.js', 'r'); var s = fs.createReadStream(null, {fd: fd}); s.pipe(process.stdout);
If there is an fd option, the file name is ignored.
Joe hildebrand
source share