The original code filename = nodePath'normalize'; is buggy when using it used with electron package.
fs.readFile will take this to a wrong path on electron packaged.
For exmaple:
I have a packaged file path "'file:///C:/**/resources/app/dist/demo.wasm", fs.readFile will throw a error like:
"Error: ENOENT: no such file or directory, open 'C::\C:\resources\app\dist\demo.wasm"
Actually it's a bug with emscripten, I have created a pull request for emscripten emscripten-core/emscripten#18226)