You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering how it is possible to use createReadStream instead of readFileSync? I am trying to read an xml which is 500MB so node is running out of heap memory so I need to read the file in chunk instead. let json = convert.xml2js( fs.readFileSync(entities.xml), { instructionHasAttributes: true, compact: true, spaces: 4, reversible: true, } );
when I change fs readFileSync to fs.createReadStream I get the following error:
UnhandledPromiseRejectionWarning: Error: Text data outside of root node.
The text was updated successfully, but these errors were encountered:
I was wondering how it is possible to use createReadStream instead of readFileSync? I am trying to read an xml which is 500MB so node is running out of heap memory so I need to read the file in chunk instead.
let json = convert.xml2js( fs.readFileSync(
entities.xml), { instructionHasAttributes: true, compact: true, spaces: 4, reversible: true, } );
when I change fs readFileSync to fs.createReadStream I get the following error:
UnhandledPromiseRejectionWarning: Error: Text data outside of root node.
The text was updated successfully, but these errors were encountered: