Closed mig82 closed 5 years ago
Never mind. My bad. I was missing the encoding parameter. From the Node documentation on readFile
:
If no encoding is specified, then the raw buffer is returned.
So I guess that attempting to parse the buffer was causing the issue. This fixed it.
const xml = await fs.readFile('path/to/file.xml', 'utf8');
I'm trying to use this library in Node.js to parse an XML file. Here's what I'm doing.
I'm getting this error:
I don't think I'm
require
ing this correctly. How do I make this work in Node?