Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: 3 months ago
JSON representation

Find the root directory of a Node.js project or npm package

Awesome Lists containing this project

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 --help

Usage
$ pkg-dir

Examples
$ 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