From daa3a5ee1ca0b620399222431557ba2243070523 Mon Sep 17 00:00:00 2001 From: Andrew Pozynuik Date: Wed, 15 Aug 2018 18:00:19 +0300 Subject: [PATCH] Posibility pass stream --- lib/big-xml.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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();