{"id":13483336,"url":"https://github.com/sindresorhus/read-package-up","last_synced_at":"2025-05-16T02:10:13.551Z","repository":{"id":1223959,"uuid":"41842429","full_name":"sindresorhus/read-package-up","owner":"sindresorhus","description":"Read the closest package.json file","archived":false,"fork":false,"pushed_at":"2023-11-04T09:30:06.000Z","size":35,"stargazers_count":267,"open_issues_count":0,"forks_count":20,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-27T04:35:27.759Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sindresorhus.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/security.md","support":null,"governance":null},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","custom":"https://sindresorhus.com/donate"}},"created_at":"2015-09-03T04:48:40.000Z","updated_at":"2025-04-22T16:35:28.000Z","dependencies_parsed_at":"2023-09-27T10:54:03.822Z","dependency_job_id":"f022eb89-6f43-4692-ad2f-adc10ae0cf9d","html_url":"https://github.com/sindresorhus/read-package-up","commit_stats":{"total_commits":40,"total_committers":9,"mean_commits":4.444444444444445,"dds":"0.19999999999999996","last_synced_commit":"ec9827e8d217d6676c78868ebb840ee787dd472c"},"previous_names":["sindresorhus/read-package-up","sindresorhus/read-pkg-up"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fread-package-up","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fread-package-up/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fread-package-up/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fread-package-up/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/read-package-up/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252922308,"owners_count":21825641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T17:01:10.219Z","updated_at":"2025-05-16T02:10:13.529Z","avatar_url":"https://github.com/sindresorhus.png","language":"TypeScript","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["Packages","JavaScript"],"sub_categories":["Other"],"readme":"# read-package-up\n\n\u003e Read the closest package.json file\n\n## Why\n\n- [Finds the closest package.json](https://github.com/sindresorhus/find-up)\n- [Throws more helpful JSON errors](https://github.com/sindresorhus/parse-json)\n- [Normalizes the data](https://github.com/npm/normalize-package-data#what-normalization-currently-entails)\n\n## Install\n\n```sh\nnpm install read-package-up\n```\n\n## Usage\n\n```js\nimport {readPackageUp} from 'read-package-up';\n\nconsole.log(await readPackageUp());\n/*\n{\n\tpackageJson: {\n\t\tname: 'awesome-package',\n\t\tversion: '1.0.0',\n\t\t…\n\t},\n\tpath: '/Users/sindresorhus/dev/awesome-package/package.json'\n}\n*/\n```\n\n## API\n\n### readPackageUp(options?)\n\nReturns a `Promise\u003cobject\u003e`, or `Promise\u003cundefined\u003e` if no `package.json` was found.\n\n### readPackageUpSync(options?)\n\nReturns the result object, or `undefined` if no `package.json` was found.\n\n#### options\n\nType: `object`\n\n##### cwd\n\nType: `URL | string`\\\nDefault: `process.cwd()`\n\nThe directory to start looking for a package.json file.\n\n##### normalize\n\nType: `boolean`\\\nDefault: `true`\n\n[Normalize](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) the package data.\n\n## Related\n\n- [read-pkg](https://github.com/sindresorhus/read-pkg) - Read a package.json file\n- [package-up](https://github.com/sindresorhus/package-up) - Find the closest package.json file\n- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories\n- [pkg-conf](https://github.com/sindresorhus/pkg-conf) - Get namespaced config from the closest package.json\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fread-package-up","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Fread-package-up","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fread-package-up/lists"}