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
pkg-dir
One common way of using this package is as follows. Maybe mention that in the readme?
import {packageDirectorySync} from 'pkg-dir'; console.log(packageDirectorySync({cwd: import.meta.url}));
{cwd: new URL(import.meta.url)}
process.cwd()
cwd
The text was updated successfully, but these errors were encountered:
Yes. Good idea. Although, I prefer to just add official URL support. I'm slowly adding URL support to places that accept paths.
If I’m not mistaken, using the default value process.cwd() for cwd can produce incorrect results for modules.
It really depends on your use-case.
Sorry, something went wrong.
I prefer to just add official URL support
So the safe way to make the call will eventually be the following code(?)
packageDirectorySync({cwd: new URL(import.meta.url)})
True!
Correct. Hopefully, Node.js will eventually get a nicer API to get the current file and directory.
No branches or pull requests
One common way of using this package is as follows. Maybe mention that in the readme?
{cwd: new URL(import.meta.url)}
.process.cwd()
forcwd
can produce incorrect results for modules.The text was updated successfully, but these errors were encountered: