{"_id":"fd-package-json","_rev":"3822381","name":"fd-package-json","description":"Utilities for finding the closest package.json file","dist-tags":{"latest":"2.0.0","next":"2.0.0-beta.0"},"maintainers":[{"name":"43081j","email":""}],"time":{"modified":"2025-07-08T07:58:29.000Z","created":"2024-03-03T13:32:21.326Z","2.0.0":"2025-05-26T20:52:59.077Z","2.0.0-beta.0":"2024-06-18T14:52:16.417Z","1.2.0":"2024-03-09T11:44:38.794Z","1.1.0":"2024-03-05T21:31:45.385Z","1.0.0":"2024-03-03T15:34:39.488Z","0.0.1":"2024-03-03T13:32:21.326Z"},"users":{},"author":{"name":"James Garbutt","url":"https://github.com/43081j"},"repository":{"type":"git","url":"git+https://github.com/es-tooling/fd-package-json.git"},"versions":{"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":{"shasum":"03f53ce5a0af552c2f4faf703a24e526310a2411","size":2460,"noattachment":false,"key":"/fd-package-json/-/fd-package-json-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/fd-package-json/download/fd-package-json-2.0.0.tgz"},"_npmUser":{"name":"43081j","email":"43081james@gmail.com"},"directories":{},"maintainers":[{"name":"43081j","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fd-package-json_2.0.0_1748292778891_0.4633405400902315"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-05-26T20:52:59.077Z","publish_time":1748292779077,"_source_registry_name":"default","_cnpm_publish_time":1748292779077},"2.0.0-beta.0":{"name":"fd-package-json","version":"2.0.0-beta.0","description":"Utilities for finding the closest package.json file","scripts":{"clean":"rimraf 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":"^8.57.0","@types/node":"^20.11.24","c8":"^10.1.2","eslint":"^8.57.0","eslint-config-google":"^0.14.0","prettier":"^3.2.5","rimraf":"^5.0.5","typescript":"^5.3.3","typescript-eslint":"^7.1.0"},"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":"^3.0.1"},"_id":"fd-package-json@2.0.0-beta.0","readmeFilename":"README.md","gitHead":"71d30c29ce0e653ba32c10d9956095c55288c6f4","_nodeVersion":"22.2.0","_npmVersion":"10.7.0","dist":{"shasum":"e57f12dd1aa299df78449f12d73a81460be7b828","size":2466,"noattachment":false,"key":"/fd-package-json/-/fd-package-json-2.0.0-beta.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/fd-package-json/download/fd-package-json-2.0.0-beta.0.tgz"},"_npmUser":{"name":"43081j","email":"43081james@gmail.com"},"directories":{},"maintainers":[{"name":"43081j","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fd-package-json_2.0.0-beta.0_1718722336257_0.703909611951212"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-06-18T14:52:16.417Z","publish_time":1718722336417,"_source_registry_name":"default","_cnpm_publish_time":1718722336417},"1.2.0":{"name":"fd-package-json","version":"1.2.0","description":"Utilities for finding the closest package.json file","scripts":{"clean":"rimraf 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":"tshy"},"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":"^8.57.0","@types/node":"^20.11.24","c8":"^9.1.0","eslint":"^8.57.0","eslint-config-google":"^0.14.0","prettier":"^3.2.5","rimraf":"^5.0.5","tshy":"^1.11.1","typescript":"^5.3.3","typescript-eslint":"^7.1.0"},"tshy":{"exclude":["src/test"],"exports":{".":"./src/main.ts","./package.json":"./package.json"}},"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"},"type":"module","main":"./dist/commonjs/main.js","types":"./dist/commonjs/main.d.ts","dependencies":{"walk-up-path":"^3.0.1"},"_id":"fd-package-json@1.2.0","gitHead":"a67f8f6160d5cdced7cac423a5fd06d0a9a2548a","_nodeVersion":"21.6.1","_npmVersion":"10.2.4","dist":{"shasum":"4f218bb8ff65c21011d1f4f17cb3d0c9e72f8da7","size":2958,"noattachment":false,"key":"/fd-package-json/-/fd-package-json-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/fd-package-json/download/fd-package-json-1.2.0.tgz"},"_npmUser":{"name":"43081j","email":"43081james@gmail.com"},"directories":{},"maintainers":[{"name":"43081j","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fd-package-json_1.2.0_1709984678640_0.18386001058205959"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-03-09T11:44:38.794Z","publish_time":1709984678794,"_source_registry_name":"default","_cnpm_publish_time":1709984678794},"1.1.0":{"name":"fd-package-json","version":"1.1.0","description":"Utilities for finding the closest package.json file","scripts":{"clean":"rimraf 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":"tshy"},"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":"^8.57.0","@types/node":"^20.11.24","c8":"^9.1.0","eslint":"^8.57.0","eslint-config-google":"^0.14.0","prettier":"^3.2.5","rimraf":"^5.0.5","tshy":"^1.11.1","typescript":"^5.3.3","typescript-eslint":"^7.1.0"},"tshy":{"exclude":["src/test"],"exports":{".":"./src/main.ts","./package.json":"./package.json"}},"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"},"type":"module","main":"./dist/commonjs/main.js","types":"./dist/commonjs/main.d.ts","dependencies":{"walk-up-path":"^3.0.1"},"_id":"fd-package-json@1.1.0","gitHead":"be4218712290e650110b2145bb6da990c5ef2011","_nodeVersion":"21.6.1","_npmVersion":"10.2.4","dist":{"shasum":"afdb53675e4849afe47c558f219b6268bb6110f3","size":2706,"noattachment":false,"key":"/fd-package-json/-/fd-package-json-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/fd-package-json/download/fd-package-json-1.1.0.tgz"},"_npmUser":{"name":"43081j","email":"43081james@gmail.com"},"directories":{},"maintainers":[{"name":"43081j","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fd-package-json_1.1.0_1709674305099_0.5072216262303264"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-03-05T21:31:45.385Z","publish_time":1709674305385,"_source_registry_name":"default","_cnpm_publish_time":1709674305385},"1.0.0":{"name":"fd-package-json","version":"1.0.0","description":"Utilities for finding the closest package.json file","scripts":{"clean":"rimraf 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 --reporter=lcov node --test","prepare":"tshy"},"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":"^8.57.0","@types/node":"^20.11.24","c8":"^9.1.0","eslint":"^8.57.0","eslint-config-google":"^0.14.0","prettier":"^3.2.5","rimraf":"^5.0.5","tshy":"^1.11.1","typescript":"^5.3.3","typescript-eslint":"^7.1.0"},"tshy":{"exclude":["src/test"],"exports":{".":"./src/main.ts","./package.json":"./package.json"}},"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"},"type":"module","main":"./dist/commonjs/main.js","types":"./dist/commonjs/main.d.ts","dependencies":{"read-package-json-fast":"^3.0.2","walk-up-path":"^3.0.1"},"_id":"fd-package-json@1.0.0","gitHead":"e58facc462f280fb631816af010b19c8684268be","_nodeVersion":"21.6.1","_npmVersion":"10.2.4","dist":{"shasum":"bc71d4e5dd2ec9e7a57089ee94a44d34fab83cc8","size":2773,"noattachment":false,"key":"/fd-package-json/-/fd-package-json-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/fd-package-json/download/fd-package-json-1.0.0.tgz"},"_npmUser":{"name":"43081j","email":"43081james@gmail.com"},"directories":{},"maintainers":[{"name":"43081j","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fd-package-json_1.0.0_1709480079282_0.09148881389200691"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-03-03T15:34:39.488Z","publish_time":1709480079488,"_source_registry_name":"default","_cnpm_publish_time":1709480079488},"0.0.1":{"name":"fd-package-json","version":"0.0.1","description":"Utilities for finding the closest package.json file","scripts":{"clean":"rimraf dist lib","build":"npm run clean && tsc","lint:format":"prettier --check src","format":"prettier --write src","lint":"npm run lint:format && eslint src","test":"node --test","prepare":"tshy"},"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":"^8.57.0","@types/node":"^20.11.24","eslint":"^8.57.0","eslint-config-google":"^0.14.0","prettier":"^3.2.5","rimraf":"^5.0.5","tshy":"^1.11.1","typescript":"^5.3.3","typescript-eslint":"^7.1.0"},"tshy":{"exclude":["src/test"],"exports":{".":"./src/main.ts","./package.json":"./package.json"}},"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"},"type":"module","main":"./dist/commonjs/main.js","types":"./dist/commonjs/main.d.ts","dependencies":{"read-package-json-fast":"^3.0.2","walk-up-path":"^3.0.1"},"_id":"fd-package-json@0.0.1","gitHead":"6d32744a85924910759b0600e04a81952d1a1cc1","_nodeVersion":"21.6.1","_npmVersion":"10.2.4","dist":{"shasum":"2f83e364d781c2ef18015098c367ee1b930ff902","size":2755,"noattachment":false,"key":"/fd-package-json/-/fd-package-json-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/fd-package-json/download/fd-package-json-0.0.1.tgz"},"_npmUser":{"name":"43081j","email":"43081james@gmail.com"},"directories":{},"maintainers":[{"name":"43081j","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fd-package-json_0.0.1_1709472741163_0.8071365850080239"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-03-03T13:32:21.326Z","publish_time":1709472741326,"_source_registry_name":"default","_cnpm_publish_time":1709472741326}},"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","_attachments":{},"homepage":"https://github.com/es-tooling/fd-package-json#readme","bugs":{"url":"https://github.com/es-tooling/fd-package-json/issues"},"license":"MIT"}