{"name":"fd-package-json","version":"2.0.0","description":"Utilities for finding the closest package.json file","scripts":{"clean":"premove dist lib","build":"npm run clean && tsc","lint:format":"prettier --check src","format":"prettier --write src","lint":"npm run lint:format && eslint src","test":"c8 node --test lib/**/*_test.js","prepare":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/es-tooling/fd-package-json.git"},"keywords":["package-json","find-pkg","pkg-up","find-up","find","walk","parents","parent"],"author":{"name":"James Garbutt","url":"https://github.com/43081j"},"license":"MIT","bugs":{"url":"https://github.com/es-tooling/fd-package-json/issues"},"homepage":"https://github.com/es-tooling/fd-package-json#readme","devDependencies":{"@eslint/js":"^9.27.0","@types/node":"^20.11.24","c8":"^10.1.3","eslint":"^9.27.0","eslint-config-google":"^0.14.0","premove":"^4.0.0","prettier":"^3.5.3","typescript":"^5.8.3","typescript-eslint":"^8.32.1"},"exports":{".":{"import":{"default":"./lib/main.js"}},"./package.json":"./package.json"},"type":"module","main":"./lib/main.js","types":"./lib/main.d.ts","dependencies":{"walk-up-path":"^4.0.0"},"_id":"fd-package-json@2.0.0","gitHead":"bbf7884a51e8f12b11924b2b2fc276eae689bd1d","_nodeVersion":"22.15.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-jKmm9YtsNXN789RS/0mSzOC1NUq9mkVd65vbSSVsKdjGvYXBuE4oWe2QOEoFeRmJg+lPuZxpmrfFclNhoRMneQ==","shasum":"03f53ce5a0af552c2f4faf703a24e526310a2411","tarball":"http://registry-npm.ywwl.com/fd-package-json/download/fd-package-json-2.0.0.tgz","fileCount":5,"unpackedSize":7678,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/fd-package-json@2.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCPF3Vz3ClaGPlSEd2Htz6nuIEs3Q3uanEY5O55OBZYGwIhAO9QGWRBgGG6XdsgDObseQKRxYza9PHrs7ePR2T5moKj"}],"size":2460,"noattachment":false,"key":"/fd-package-json/-/fd-package-json-2.0.0.tgz"},"_npmUser":{"name":"43081j","email":"43081james@gmail.com"},"directories":{},"maintainers":[{"name":"43081j","email":"43081james@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fd-package-json_2.0.0_1748292778891_0.4633405400902315"},"_hasShrinkwrap":false,"readme":"# fd-package-json\n\nFinds the closest `package.json` and returns the path or the contents.\n\n## Install\n\n```sh\nnpm i -S fd-package-json\n```\n\n## Usage\n\nTo retrieve the path of the closest package, you can use `findPackagePath`:\n\n```ts\nimport {findPackagePath} from 'fd-package-json';\n\n// Closest package path to cwd of the process\nawait findPackagePath(process.cwd());\n\n// Closest package path to the current file (CJS)\nawait findPackagePath(__dirname);\n\n// Closest package path to the current file (ESM)\nawait findPackagePath(fileURLToPath(new URL('.', import.meta.url)));\n```\n\nTo retrieve the package itself, you may use `findPackage` with the same\nparameter:\n\n```ts\nawait findPackage(process.cwd()); // Returns the JSON of the package if found\n```\n\nSynchronous methods also exist:\n\n```ts\nfindPackageSync(process.cwd()); // returns the package\n\nfindPackagePathSync(process.cwd()); // returns the package path\n```\n\n## License\n\nMIT\n","publish_time":1748292779077,"_cnpm_publish_time":1748292779077,"dist-tags":{"latest":"2.0.0","next":"2.0.0-beta.0"}}