@0x-jerry/load-pkg
v0.1.5
Published
Detect the closest `package.json` recursively.
Downloads
110
Readme
Load Pkg
Detect the closest package.json
recursively.
Example
const pkgFile = await loadPkg(path.join(__dirname, 'example/packages/pkg1'))
console.log(pkgFile)
output:
{
"path": "<root-path>/example/packages/pkg1/package.json",
"config": {}, // content of `package.json`
"monorepo": false,
"parent": {
"path": "<root-path>/example/package.json",
"config": {}, // content of `package.json`
"monorepo": true,
"parent": {
"path": "<root-path>/package.json",
"config": {}, // content of `package.json`
"monorepo": false
}
}
}