If you just clone the project, do a npm install and run the script as described in readme.md it will end up with the following error:
node:events:505
throw er; // Unhandled 'error' event
^
TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received 'utf-8'
←[90m at maybeCallback (node:fs:177:3)←[39m
←[90m at Object.writeFile (node:fs:2118:14)←[39m
at D:\knx-ets5-ga-reader-master\test-file.js:54:8
at Parser.<anonymous> (D:\knx-ets5-ga-reader-master\node_modules\←[4mxml2js←[24m\lib\parser.js:304:18)
←[90m at Parser.emit (node:events:527:28)←[39m
at SAXParser.onclosetag (D:\knx-ets5-ga-reader-master\node_modules\←[4mxml2js←[24m\lib\parser.js:262:26)
at emit (D:\knx-ets5-ga-reader-master\node_modules\←[4msax←[24m\lib\sax.js:624:35)
at emitNode (D:\knx-ets5-ga-reader-master\node_modules\←[4msax←[24m\lib\sax.js:629:5)
at closeTag (D:\knx-ets5-ga-reader-master\node_modules\←[4msax←[24m\lib\sax.js:889:7)
at SAXParser.write (D:\knx-ets5-ga-reader-master\node_modules\←[4msax←[24m\lib\sax.js:1436:13)
Emitted 'error' event on Parser instance at:
at Parser.exports.Parser.Parser.parseString (D:\knx-ets5-ga-reader-master\node_modules\←[4mxml2js←[24m\lib\parser.js:327:16)
at Parser.parseString (D:\knx-ets5-ga-reader-master\node_modules\←[4mxml2js←[24m\lib\parser.js:5:59)
at D:\knx-ets5-ga-reader-master\test-file.js:25:10
←[90m at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)←[39m {
code: ←[32m'ERR_INVALID_CALLBACK'←[39m
}
To be compatible with newest node version and the current fs package you need to specify a callback function like:
If you just clone the project, do a npm install and run the script as described in readme.md it will end up with the following error:
To be compatible with newest node version and the current
fs
package you need to specify a callback function like: