Find the closest package.json file
npm install package-up> Find the closest package.json file
``sh`
npm install package-up
``
/
└── Users
└── sindresorhus
└── foo
├── package.json
└── bar
├── baz
└── example.js
`js
// example.js
import {packageUp} from 'package-up';
console.log(await packageUp());
//=> '/Users/sindresorhus/foo/package.json'
`
Returns a Promise for the file path, or Promise if it could not be found.
Returns the file path, or undefined if it could not be found.
#### options
Type: object
#### cwd
Type: string\process.cwd()`
Default:
The directory to start from.
- read-pkg-up - Read the closest package.json file
- pkg-dir - Find the root directory of an npm package
- find-up - Find a file by walking up parent directories