diff --git a/lib/big-xml.js b/lib/big-xml.js index 88d1789..07472fa 100644 --- a/lib/big-xml.js +++ b/lib/big-xml.js @@ -15,7 +15,7 @@ function BigXmlReader(filename, recordRegEx, options) { options.gzip = options.gzip || false; var parser = new expat.Parser('UTF-8'); - var stream = fs.createReadStream(filename); + var stream = typeof filename === "string" ? fs.createReadStream(filename) : filename; if (options.gzip) { var gunzip = zlib.createGunzip();