We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
URL
Currently, the makeDir function doesn't accept a file URL instance:
makeDir
import makeDir from 'make-dir'; await makeDir(new URL('foo/', import.meta.url));
Results in the following error:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of URL
This makes make-dir harder to work with within Node.js ESM modules.
make-dir
Users will run into this gotcha more frequently as most Node.js APIs that work with filesystem paths accept file URL instances, including mkdir.
mkdir
In the meantime, we have to do this workaround:
import { fileURLToPath } from 'url'; import makeDir from 'make-dir'; await makeDir(fileURLToPath(new URL('foo/', import.meta.url)));
The text was updated successfully, but these errors were encountered:
PR welcome to add it.
Sorry, something went wrong.
okey i am here to help you can i try?
Successfully merging a pull request may close this issue.
Currently, the
makeDir
function doesn't accept a fileURL
instance:Results in the following error:
This makes
make-dir
harder to work with within Node.js ESM modules.Users will run into this gotcha more frequently as most Node.js APIs that work with filesystem paths accept file
URL
instances, includingmkdir
.In the meantime, we have to do this workaround:
The text was updated successfully, but these errors were encountered: