# pkg-up
找到最内层的package.json
路径。
Find the closest package.json file
# Usage
/
└── Users
└── sindresorhus
└── foo
├── package.json
└── bar
├── baz
└── example.js
// example.js
import {pkgUp} from 'pkg-up';
console.log(await pkgUp());
//=> '/Users/sindresorhus/foo/package.json'
# API
# pkgUp(options?)
Returns a Promise
# pkgUpSync(options?)
Returns the file path, or undefined if it could not be found.
# options
Type: object
# cwd
Type: string Default: process.cwd()
The directory to start from.
# 参考
← get-port read-pkg-up →