As of v2.1.5, the LocalStorage.init will attempt to create a directory for the location provided, however it will fail if there are multiple directories in the path that do not exist.
Error: ENOENT: no such file or directory, mkdir 'C:\Workspaces\my-app\does_not_exist\desired_location'
at Object.mkdirSync (fs.js:753:3)
at LocalStorage._init (C:\Workspaces\my-app\node_modules\node-localstorage\LocalStorage.js:183:14)
at new LocalStorage (C:\Workspaces\my-app\node_modules\node-localstorage\LocalStorage.js:124:12)
at Object.<anonymous> (C:\Workspaces\my-app\main.js:16:19)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
As of Node.js v10.12:
fs
Added a recursive option to fs.mkdir and fs.mkdirSync. If this option is set to true, non-existing parent folders will be automatically created. #21875
As of v2.1.5, the LocalStorage.init will attempt to create a directory for the location provided, however it will fail if there are multiple directories in the path that do not exist.
Throws the error:
As of Node.js v10.12: