- Notifications
You must be signed in to change notification settings - Fork13
Find the closest package.json file
License
NotificationsYou must be signed in to change notification settings
sindresorhus/package-up
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Find the closest package.json file
npm install package-up
/└── Users └── sindresorhus └── foo ├── package.json └── bar ├── baz └── example.js
// example.jsimport{packageUp}from'package-up';console.log(awaitpackageUp());//=> '/Users/sindresorhus/foo/package.json'
Returns aPromise<string>
for the file path, orPromise<undefined>
if it could not be found.
Returns the file path, orundefined
if it could not be found.
Type:object
Type:string
Default:process.cwd()
The directory to start from.
- read-package-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
About
Find the closest package.json file
Resources
License
Code of conduct
Security policy
Stars
Watchers
Forks
Packages0
No packages published