Get the current working directory relative to the calling module.
Installations
npm install cwd
Score
88.9
Supply Chain
51
Quality
74.4
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Developer
Developer Guide
Module System
CommonJS
Min. Node Version
>=0.8
Typescript Support
No
Node Version
6.2.0
NPM Version
3.8.9
Statistics
12 Stars
51 Commits
2 Forks
3 Watching
1 Branches
2 Contributors
Updated on 11 Jan 2024
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
150,300,120
Last day
-5.3%
255,908
Compared to previous day
Last week
1.7%
1,424,162
Compared to previous week
Last month
11.2%
5,881,213
Compared to previous month
Last year
58.4%
53,224,240
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
2
Dev Dependencies
3
cwd
Easily get the CWD (current working directory) of a project based on package.json, optionally starting from a given path. (node.js/javascript util)
Install
Install with npm:
1$ npm install cwd --save
Usage
1var cwd = require('cwd'); 2cwd(); 3cwd('one/two.js'); 4cwd('one', 'two.js'); 5cwd(['one', 'two.js']);
Related projects
You might also be interested in these projects:
- global-modules: The directory used by npm for globally installed npm modules. | homepage
- global-paths: Returns an array of unique "global" directories based on the user's platform and environment. The… more | [homepage](https://github.com/jonschlinkert/global-paths "Returns an array of unique "global" directories based on the user's platform and environment. The resulting paths can be used for doing lookups for generators or other globally installed npm packages. Node.js / JavaScript.")
- global-prefix: Get the npm global path prefix. | homepage
- is-absolute: Polyfill for node.js
path.isAbolute
. Returns true if a file path is absolute. | homepage - is-relative: Returns
true
if the path appears to be relative. | homepage - relative: Get the relative filepath from path A to path B. Calculates from file-to-directory, file-to-file, directory-to-file… more | homepage
Contributing
This document was generated by verb, please don't edit directly. Any changes to the readme must be made in .verb.md. See Building Docs.
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Building docs
Generate readme and API documentation with verb:
1$ npm install -g verb verb-readme-generator && verb
Running tests
Install dev dependencies:
1$ npm install -d && npm test
Author
Jon Schlinkert
License
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb, v0.9.0, on June 05, 2016.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
3
/10
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More