Find the root directory of a Node.js project or npm package
npm install --global pkg-dir-cli
$ pkg-dir --help
Usage
$ pkg-dir <cwd>
Examples
$ echo $PWD
/Users/sindresorhus/foo/bar
$ pkg-dir
/Users/sindresorhus/foo
/
└── Users
└── sindresorhus
└── foo
├── package.json
└── bar
└── example.js
$ echo $PWD
/Users/sindresorhus/foo/bar
$ pkg-dir
/Users/sindresorhus/foo
- pkg-dir - API for this module
- find-up-cli - Find a file by walking up parent directories