Closed Jan-Ka closed 7 years ago
Not sure if mkdirp is the real culprit here, while my observation with it is true I found out that the newest version of file-exists also switched to the same pattern of having an async default function and an sync fallback.
50% sure this is only an issue because I decided to upgrade packages prematurely instead of waiting for #33.
Your observations are true, we should use the sync version. A stat
and a mkdirp
should take miniscule time on all modern computers.
This is a change in the API, I think. I should have freezed the versions in the package.json
. :slightly_frowning_face:
Anyway, this is the plan I have for now:
file-exists
dependency. Instead use fs.existsSync
When running the application for the first time the user will experience an error like
It appears to be a timing issue when creating the folder with mkdirp. The default function is asynchronous, there is a dedicated synchronized version.
mkdirp
does not return it's internal promise, because of this it would be probably better to either switch tomkdirp.sync
or to create a own version.