What means of current working directory
.
In my project
learnNode
ββ node_modules
ββ webpack-cli
ββ bin
ββ cli.js
const resolveCwd = require('resolve-cwd');
const filePath = 'webpack-cli/bin/cli.js';
const localFile = resolveCwd.silent(filePath);
console.log(process.cwd())
console.log(localFile)
process.cwd()
print is /Users/tt/Study/leanrNode
localFile
print is /Users/tt/Study/leanrNode/node_modules/webpack-cli/bin/cli.js
Resolve the path of a module like require.resolve()
but from the current working directory
Should current working directory be 'leanrNode'?
Expected localFile
print /Users/tt/Study/leanrNode/webpack-cli/bin/cli.js
?
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too