resolve-cwd
npmv3.0.0Resolve the path of a module like `require.resolve()` but from the current working directory
Not recommended for new projects
No — resolve-cwd should not be adopted for new projects. Last published 2689 days ago.
- ?Adoption: grade ?, Not reported by this registry.
No download data reported for this package yet.
- FMaintenance: grade F, Failing.
Last published 2689 days ago.
- AWeight: grade A, Excellent.
Pulls in 1 transitive package, about 11 KB installed.
- BSupply chain: grade B, Good.
This package has a single maintainer (bus factor of 1).
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding resolve-cwd to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Licenses in the dependency tree
Every license you inherit by installing resolve-cwd, not just its own. Check this before a legal review, not after.
Compatibility
- Node.js
- node >=8
- Module format
- CommonJS only
- TypeScript
- No bundled types
- Install scripts
- None
Quick start
A usage example from the resolve-cwd README.
const resolveCwd = require('resolve-cwd');
console.log(__dirname);
//=> '/Users/sindresorhus/rainbow'
console.log(process.cwd());
//=> '/Users/sindresorhus/unicorn'
console.log(resolveCwd('./foo'));
//=> '/Users/sindresorhus/unicorn/foo.js'resolve-cwd vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| resolve-cwdthis page | 0 | 1 | MIT | 7 years ago |
| resolve-from | 0 | 8 | MIT | 1 day ago |
| find-up | 0 | 4 | MIT | 1 day ago |
| import-local | 0 | 2 | MIT | 1 day ago |
| pkg-dirdeprecated | 0 | 1 | MIT | 1 day ago |
| resolve | 0 | 2 | MIT | 1 day ago |
Dependencies
Declared by resolve-cwd v3.0.0. Runtime dependencies are installed with the package; dev dependencies are not.
Runtime (1)
Dev (3)
Used by
Popular packages that depend on resolve-cwd.
Relationship graph
Dependencies (left) and dependents (right) of resolve-cwd.
Frequently installed together
Release history
No releases in the last two years, typically about 732 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 3.0.0latest | 7 years ago | 4.9 KB | MIT |
| 2.0.0 | 9 years ago | — | MIT |
| 1.0.0 | 10 years ago | — | MIT |
Overview
resolve-cwd is an npm package that resolve the path of a module like `require.resolve()` but from the current working directory. It has 1 known dependents in the graph. The latest version is 3.0.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need resolve the path of a module like `require.resolve()` but from the current working directory and value a focused solution.
When not to use it
Consider an alternative if you need to have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.
Pros
- Clear open-source license (MIT).
Cons
- No bundled TypeScript types (may require a separate @types package).
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Frequently asked questions
Should I use resolve-cwd?
No — resolve-cwd should not be adopted for new projects. Last published 2689 days ago.
How do I install resolve-cwd?
Run `npm install resolve-cwd` to add resolve-cwd to your npm project.
How many dependencies does resolve-cwd have?
resolve-cwd declares 4 direct dependencies and pulls in 1 packages in total once its runtime tree is resolved totalling about 11 KB on disk.
What license is resolve-cwd released under?
resolve-cwd is distributed under the MIT license.
How popular is resolve-cwd?
npm does not publish download counts. Within PackageGraph's crawl, 1 known packages depend on resolve-cwd.
Is resolve-cwd still maintained?
The most recent release of resolve-cwd (v3.0.0) was published 7 years ago.
Does resolve-cwd run install scripts?
No. resolve-cwd does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.