package
Find the closest package.json file
npm install pkg-upGitHub-flavored package documentation.
Across all versions, last 30 days.
95,223,629 in 30 days
Runtime metadata.
Tagged topics.
Find the closest package.json file
npm install pkg-up/
└── 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'Returns a Promise<string> for the file path, or Promise<undefined> if it could not be found.
Returns the file path, or undefined if it could not be found.
Type: object
Type: string
Default: process.cwd()
The directory to start from.
Estimated unpacked size across 5 packages.
50.7 kB
Includes dependencies.