- Node.js Version: 8.11.3
- OS: Windows 10
- Scope (install, code, runtime, meta, other?): code
- Module (and version) (if relevant): File System
I am trying to read files out of a .asar archive using readdirSync, and am having trouble. Attempting to read out of the archive returns this error:
Error: ENOTDIR: not a directory, scandir 'C:\Users\xxxx\Desktop\xxxxxx\xxxxxx\dist\win-unpacked\resources\app.asar'
at Object.fs.readdirSync (fs.js:904:18)
Code to reproduce:
var fs = require('fs');
fs.readdirSync('C:/path/to/app.asar');
For context, this is the app.asar file from my electron-builder output, but I expected that fs would allow me to read the contents of the archive. I've also tried constructing the path with path.join(...) but that did not make a difference.
I am trying to read files out of a .asar archive using readdirSync, and am having trouble. Attempting to read out of the archive returns this error:
Code to reproduce:
For context, this is the app.asar file from my electron-builder output, but I expected that
fswould allow me to read the contents of the archive. I've also tried constructing the path withpath.join(...)but that did not make a difference.