{"_id":"fd-package-json","_rev":"6-ac4f5a8622b68ac3ddcd9d78f4023b93","name":"fd-package-json","dist-tags":{"latest":"2.0.0","next":"2.0.0-beta.0"},"versions":{"0.0.1":{"name":"fd-package-json","version":"0.0.1","keywords":["package-json","find-pkg","pkg-up","find-up","find","walk","parents","parent"],"author":{"url":"https://github.com/43081j","name":"James Garbutt"},"license":"MIT","_id":"fd-package-json@0.0.1","maintainers":[{"name":"43081j","email":"43081james@gmail.com"}],"homepage":"https://github.com/es-tooling/fd-package-json#readme","bugs":{"url":"https://github.com/es-tooling/fd-package-json/issues"},"dist":{"shasum":"2f83e364d781c2ef18015098c367ee1b930ff902","tarball":"https://registry.npmjs.org/fd-package-json/-/fd-package-json-0.0.1.tgz","fileCount":9,"integrity":"sha512-UX4xmZGaNpcev4iNALR9beJ9098Vp+1MLxY2bg/Y8jLhTd1LP0gxzNkDoShlSo3iOTvoLedppGdg0wGEOOxqHA==","signatures":[{"sig":"MEUCICP2zEzYpy//pxKhce7iYmq1hKBnRTQFw/pX4VLfVj13AiEAzAHpF9Q+Flf6dQvNYVee9tTvG4VsX1k45ggggYRBqQM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8351},"main":"./dist/commonjs/main.js","tshy":{"exclude":["src/test"],"exports":{".":"./src/main.ts","./package.json":"./package.json"}},"type":"module","types":"./dist/commonjs/main.d.ts","exports":{".":{"import":{"types":"./dist/esm/main.d.ts","default":"./dist/esm/main.js"},"require":{"types":"./dist/commonjs/main.d.ts","default":"./dist/commonjs/main.js"}},"./package.json":"./package.json"},"gitHead":"6d32744a85924910759b0600e04a81952d1a1cc1","scripts":{"lint":"npm run lint:format && eslint src","test":"node --test","build":"npm run clean && tsc","clean":"rimraf dist lib","format":"prettier --write src","prepare":"tshy","lint:format":"prettier --check src"},"_npmUser":{"name":"43081j","email":"43081james@gmail.com"},"repository":{"url":"git+https://github.com/es-tooling/fd-package-json.git","type":"git"},"_npmVersion":"10.2.4","description":"Utilities for finding the closest package.json file","directories":{},"_nodeVersion":"21.6.1","dependencies":{"walk-up-path":"^3.0.1","read-package-json-fast":"^3.0.2"},"_hasShrinkwrap":false,"devDependencies":{"tshy":"^1.11.1","eslint":"^8.57.0","rimraf":"^5.0.5","prettier":"^3.2.5","@eslint/js":"^8.57.0","typescript":"^5.3.3","@types/node":"^20.11.24","typescript-eslint":"^7.1.0","eslint-config-google":"^0.14.0"},"_npmOperationalInternal":{"tmp":"tmp/fd-package-json_0.0.1_1709472741163_0.8071365850080239","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"fd-package-json","version":"1.0.0","keywords":["package-json","find-pkg","pkg-up","find-up","find","walk","parents","parent"],"author":{"url":"https://github.com/43081j","name":"James Garbutt"},"license":"MIT","_id":"fd-package-json@1.0.0","maintainers":[{"name":"43081j","email":"43081james@gmail.com"}],"homepage":"https://github.com/es-tooling/fd-package-json#readme","bugs":{"url":"https://github.com/es-tooling/fd-package-json/issues"},"dist":{"shasum":"bc71d4e5dd2ec9e7a57089ee94a44d34fab83cc8","tarball":"https://registry.npmjs.org/fd-package-json/-/fd-package-json-1.0.0.tgz","fileCount":9,"integrity":"sha512-mdjoUwQidv/F6y1o/ySttB+ielbvT9n/zI5rKpriw+bb6Uxh4mtVaY1dY5JUCeLimCEjYDurD1vMZ+P5lEf7fQ==","signatures":[{"sig":"MEQCIBOLev4b7Stl1R2x2YiuWLSxmvxpVoAZiJF60LThNWpwAiAhM6DDMjfsKU9i9VGysQbhPeIjSDQEuTXFynbZSYJa1Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8390},"main":"./dist/commonjs/main.js","tshy":{"exclude":["src/test"],"exports":{".":"./src/main.ts","./package.json":"./package.json"}},"type":"module","types":"./dist/commonjs/main.d.ts","exports":{".":{"import":{"types":"./dist/esm/main.d.ts","default":"./dist/esm/main.js"},"require":{"types":"./dist/commonjs/main.d.ts","default":"./dist/commonjs/main.js"}},"./package.json":"./package.json"},"gitHead":"e58facc462f280fb631816af010b19c8684268be","scripts":{"lint":"npm run lint:format && eslint src","test":"c8 --reporter=lcov node --test","build":"npm run clean && tsc","clean":"rimraf dist lib","format":"prettier --write src","prepare":"tshy","lint:format":"prettier --check src"},"_npmUser":{"name":"43081j","email":"43081james@gmail.com"},"repository":{"url":"git+https://github.com/es-tooling/fd-package-json.git","type":"git"},"_npmVersion":"10.2.4","description":"Utilities for finding the closest package.json file","directories":{},"_nodeVersion":"21.6.1","dependencies":{"walk-up-path":"^3.0.1","read-package-json-fast":"^3.0.2"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^9.1.0","tshy":"^1.11.1","eslint":"^8.57.0","rimraf":"^5.0.5","prettier":"^3.2.5","@eslint/js":"^8.57.0","typescript":"^5.3.3","@types/node":"^20.11.24","typescript-eslint":"^7.1.0","eslint-config-google":"^0.14.0"},"_npmOperationalInternal":{"tmp":"tmp/fd-package-json_1.0.0_1709480079282_0.09148881389200691","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"fd-package-json","version":"1.1.0","keywords":["package-json","find-pkg","pkg-up","find-up","find","walk","parents","parent"],"author":{"url":"https://github.com/43081j","name":"James Garbutt"},"license":"MIT","_id":"fd-package-json@1.1.0","maintainers":[{"name":"43081j","email":"43081james@gmail.com"}],"homepage":"https://github.com/es-tooling/fd-package-json#readme","bugs":{"url":"https://github.com/es-tooling/fd-package-json/issues"},"dist":{"shasum":"afdb53675e4849afe47c558f219b6268bb6110f3","tarball":"https://registry.npmjs.org/fd-package-json/-/fd-package-json-1.1.0.tgz","fileCount":9,"integrity":"sha512-lk4PpooybtadresK981yRCBLlaGiKNblZneCRjineiB0eyRYhB+4h5A7NzHOGQj2F6wwVerk2a1kjQIiVQi0UA==","signatures":[{"sig":"MEUCIQCm/tmMTYKwweTqb/DiHLeDtfQrDd97wxmbw9YO3pQcAAIgDIqeevIW/EVFa8U7t+YvX/L/5exD5kdQFwFpLqGDBzY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8361},"main":"./dist/commonjs/main.js","tshy":{"exclude":["src/test"],"exports":{".":"./src/main.ts","./package.json":"./package.json"}},"type":"module","types":"./dist/commonjs/main.d.ts","exports":{".":{"import":{"types":"./dist/esm/main.d.ts","default":"./dist/esm/main.js"},"require":{"types":"./dist/commonjs/main.d.ts","default":"./dist/commonjs/main.js"}},"./package.json":"./package.json"},"gitHead":"be4218712290e650110b2145bb6da990c5ef2011","scripts":{"lint":"npm run lint:format && eslint src","test":"c8 node --test lib/**/*_test.js","build":"npm run clean && tsc","clean":"rimraf dist lib","format":"prettier --write src","prepare":"tshy","lint:format":"prettier --check src"},"_npmUser":{"name":"43081j","email":"43081james@gmail.com"},"repository":{"url":"git+https://github.com/es-tooling/fd-package-json.git","type":"git"},"_npmVersion":"10.2.4","description":"Utilities for finding the closest package.json file","directories":{},"_nodeVersion":"21.6.1","dependencies":{"walk-up-path":"^3.0.1"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^9.1.0","tshy":"^1.11.1","eslint":"^8.57.0","rimraf":"^5.0.5","prettier":"^3.2.5","@eslint/js":"^8.57.0","typescript":"^5.3.3","@types/node":"^20.11.24","typescript-eslint":"^7.1.0","eslint-config-google":"^0.14.0"},"_npmOperationalInternal":{"tmp":"tmp/fd-package-json_1.1.0_1709674305099_0.5072216262303264","host":"s3://npm-registry-packages"}},"1.2.0":{"name":"fd-package-json","version":"1.2.0","keywords":["package-json","find-pkg","pkg-up","find-up","find","walk","parents","parent"],"author":{"url":"https://github.com/43081j","name":"James Garbutt"},"license":"MIT","_id":"fd-package-json@1.2.0","maintainers":[{"name":"43081j","email":"43081james@gmail.com"}],"homepage":"https://github.com/es-tooling/fd-package-json#readme","bugs":{"url":"https://github.com/es-tooling/fd-package-json/issues"},"dist":{"shasum":"4f218bb8ff65c21011d1f4f17cb3d0c9e72f8da7","tarball":"https://registry.npmjs.org/fd-package-json/-/fd-package-json-1.2.0.tgz","fileCount":9,"integrity":"sha512-45LSPmWf+gC5tdCQMNH4s9Sr00bIkiD9aN7dc5hqkrEw1geRYyDQS1v1oMHAW3ysfxfndqGsrDREHHjNNbKUfA==","signatures":[{"sig":"MEUCIFTMZn7SIDzIVgYkUwZyIFMb8tt96c7C5jTIXF118ZwSAiEAg76ahX/45AWOm9WxMRAH4gBZj/S3iD80Lm1FjasW9hM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12762},"main":"./dist/commonjs/main.js","tshy":{"exclude":["src/test"],"exports":{".":"./src/main.ts","./package.json":"./package.json"}},"type":"module","types":"./dist/commonjs/main.d.ts","exports":{".":{"import":{"types":"./dist/esm/main.d.ts","default":"./dist/esm/main.js"},"require":{"types":"./dist/commonjs/main.d.ts","default":"./dist/commonjs/main.js"}},"./package.json":"./package.json"},"gitHead":"a67f8f6160d5cdced7cac423a5fd06d0a9a2548a","scripts":{"lint":"npm run lint:format && eslint src","test":"c8 node --test lib/**/*_test.js","build":"npm run clean && tsc","clean":"rimraf dist lib","format":"prettier --write src","prepare":"tshy","lint:format":"prettier --check src"},"_npmUser":{"name":"43081j","email":"43081james@gmail.com"},"repository":{"url":"git+https://github.com/es-tooling/fd-package-json.git","type":"git"},"_npmVersion":"10.2.4","description":"Utilities for finding the closest package.json file","directories":{},"_nodeVersion":"21.6.1","dependencies":{"walk-up-path":"^3.0.1"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^9.1.0","tshy":"^1.11.1","eslint":"^8.57.0","rimraf":"^5.0.5","prettier":"^3.2.5","@eslint/js":"^8.57.0","typescript":"^5.3.3","@types/node":"^20.11.24","typescript-eslint":"^7.1.0","eslint-config-google":"^0.14.0"},"_npmOperationalInternal":{"tmp":"tmp/fd-package-json_1.2.0_1709984678640_0.18386001058205959","host":"s3://npm-registry-packages"}},"2.0.0-beta.0":{"name":"fd-package-json","version":"2.0.0-beta.0","keywords":["package-json","find-pkg","pkg-up","find-up","find","walk","parents","parent"],"author":{"url":"https://github.com/43081j","name":"James Garbutt"},"license":"MIT","_id":"fd-package-json@2.0.0-beta.0","maintainers":[{"name":"43081j","email":"43081james@gmail.com"}],"homepage":"https://github.com/es-tooling/fd-package-json#readme","bugs":{"url":"https://github.com/es-tooling/fd-package-json/issues"},"dist":{"shasum":"e57f12dd1aa299df78449f12d73a81460be7b828","tarball":"https://registry.npmjs.org/fd-package-json/-/fd-package-json-2.0.0-beta.0.tgz","fileCount":5,"integrity":"sha512-GlWw2WAivvn4n5A4AXWmgHsak5fJ+8ImX2642g93f88JUn5qji6K5o3RzYDZfnRbYf9dPAlaE3Ci97fZvqXlLQ==","signatures":[{"sig":"MEUCICJs2MMOsgFlwLy+TFqavGobRmoBv7waSoREHqLO9eaEAiEAx5jFINwEbjT3ySYvaeVyJW3AEl3xIBhGN1oaPBMxTzo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/fd-package-json@2.0.0-beta.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":7682},"main":"./lib/main.js","type":"module","types":"./lib/main.d.ts","exports":{".":{"import":{"default":"./lib/main.js"}},"./package.json":"./package.json"},"gitHead":"71d30c29ce0e653ba32c10d9956095c55288c6f4","scripts":{"lint":"npm run lint:format && eslint src","test":"c8 node --test lib/**/*_test.js","build":"npm run clean && tsc","clean":"rimraf dist lib","format":"prettier --write src","prepare":"npm run build","lint:format":"prettier --check src"},"_npmUser":{"name":"43081j","email":"43081james@gmail.com"},"repository":{"url":"git+https://github.com/es-tooling/fd-package-json.git","type":"git"},"_npmVersion":"10.7.0","description":"Utilities for finding the closest package.json file","directories":{},"_nodeVersion":"22.2.0","dependencies":{"walk-up-path":"^3.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"c8":"^10.1.2","eslint":"^8.57.0","rimraf":"^5.0.5","prettier":"^3.2.5","@eslint/js":"^8.57.0","typescript":"^5.3.3","@types/node":"^20.11.24","typescript-eslint":"^7.1.0","eslint-config-google":"^0.14.0"},"_npmOperationalInternal":{"tmp":"tmp/fd-package-json_2.0.0-beta.0_1718722336257_0.703909611951212","host":"s3://npm-registry-packages"}},"2.0.0":{"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":"https://registry.npmjs.org/fd-package-json/-/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"}]},"_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}},"time":{"created":"2024-03-03T13:32:21.162Z","modified":"2025-05-26T20:52:59.532Z","0.0.1":"2024-03-03T13:32:21.326Z","1.0.0":"2024-03-03T15:34:39.488Z","1.1.0":"2024-03-05T21:31:45.385Z","1.2.0":"2024-03-09T11:44:38.794Z","2.0.0-beta.0":"2024-06-18T14:52:16.417Z","2.0.0":"2025-05-26T20:52:59.077Z"},"bugs":{"url":"https://github.com/es-tooling/fd-package-json/issues"},"author":{"name":"James Garbutt","url":"https://github.com/43081j"},"license":"MIT","homepage":"https://github.com/es-tooling/fd-package-json#readme","keywords":["package-json","find-pkg","pkg-up","find-up","find","walk","parents","parent"],"repository":{"type":"git","url":"git+https://github.com/es-tooling/fd-package-json.git"},"description":"Utilities for finding the closest package.json file","maintainers":[{"name":"43081j","email":"43081james@gmail.com"}],"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","readmeFilename":"README.md"}