Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/pkg-dir-cli
Find the root directory of a Node.js project or npm package
https://github.com/sindresorhus/pkg-dir-cli
Last synced: about 2 months ago
JSON representation
Find the root directory of a Node.js project or npm package
- Host: GitHub
- URL: https://github.com/sindresorhus/pkg-dir-cli
- Owner: sindresorhus
- License: mit
- Created: 2015-09-01T08:08:23.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2023-11-04T08:46:46.000Z (11 months ago)
- Last Synced: 2024-03-24T14:17:09.801Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 23
- Watchers: 7
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
- awesome-cli-apps - pkg-dir-cli - Find the root directory of a npm package. (Development / Npm)
- fucking-awesome-cli-apps - pkg-dir-cli - Find the root directory of a npm package. (Development / Npm)
README
# pkg-dir-cli
> Find the root directory of a Node.js project or npm package
## Install
```sh
npm install --global pkg-dir-cli
```## Usage
```
$ pkg-dir --helpUsage
$ pkg-dirExamples
$ echo $PWD
/Users/sindresorhus/foo/bar
$ pkg-dir
/Users/sindresorhus/foo
```## Example
```
/
└── Users
└── sindresorhus
└── foo
├── package.json
└── bar
└── example.js
``````
$ echo $PWD
/Users/sindresorhus/foo/bar
$ pkg-dir
/Users/sindresorhus/foo
```## Related
- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - API for this module
- [find-up-cli](https://github.com/sindresorhus/find-up-cli) - Find a file by walking up parent directories