{"id":14384673,"url":"https://github.com/github-modules/get-repo-package-json","last_synced_at":"2025-04-15T13:34:03.686Z","repository":{"id":57250408,"uuid":"65116122","full_name":"github-modules/get-repo-package-json","owner":"github-modules","description":"🐱 Fetch a GitHub repository's package.json file using the GitHub API","archived":false,"fork":false,"pushed_at":"2018-06-07T08:05:26.000Z","size":27,"stargazers_count":8,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-08T08:54:46.021Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://npm.im/get-repo-package-json","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/github-modules.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-07T04:47:40.000Z","updated_at":"2021-09-29T10:38:46.000Z","dependencies_parsed_at":"2022-08-24T16:51:41.479Z","dependency_job_id":null,"html_url":"https://github.com/github-modules/get-repo-package-json","commit_stats":null,"previous_names":["zeke/get-repo-package-json"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github-modules%2Fget-repo-package-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github-modules%2Fget-repo-package-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github-modules%2Fget-repo-package-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github-modules%2Fget-repo-package-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/github-modules","download_url":"https://codeload.github.com/github-modules/get-repo-package-json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223673684,"owners_count":17183764,"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-08-28T18:01:34.126Z","updated_at":"2024-11-08T11:19:39.179Z","avatar_url":"https://github.com/github-modules.png","language":"JavaScript","readme":"# get-repo-package-json\n\nFetch a GitHub repository's package.json file using the GitHub API\n\n## Installation\n\n```sh\nnpm install get-repo-package-json --save\n```\n\n## Usage\n\nThe basics:\n\n```js\nconst getPackage = require('get-repo-package-json')\n\ngetPackage('segmentio/nightmare').then(pkg =\u003e { console.log(pkg) })\n```\n\nTo fetch a specific commit/branch/tag, use a long-form URL:\n\n```js\nawait getPackage('https://github.com/monkey/business/tree/experiment')\n```\n\nOr specify a `ref` option:\n\n```js\nawait getPackage('monkey/business', {ref: '0e783153885ed78f71d138085a77644ff8e59aa1'})\n```\n\nTo see more supported repository string formats, see the\n[github-url-to-object](https://zeke.github.io/github-url-to-object/) demo.\n\n## API\n\nThis package exports a single function that returns a promise.\n\n### `getPackage(repository, [options])`\n\n- `repository` (string) - Any string supported by\n[github-url-to-object](https://zeke.github.io/github-url-to-object/).\n- `options` (optional object)\n  - `access_token` - GitHub API key. Can also be set as a `GITHUB_ACCESS_TOKEN` environment variable.\n  - `ref` - The name of the commit/branch/tag. Defaults to nothing, so the GitHub API will return the repo's default branch.\n\n## Tests\n\n```sh\nnpm install\nnpm test\n```\n\n## License\n\nMIT","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub-modules%2Fget-repo-package-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithub-modules%2Fget-repo-package-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub-modules%2Fget-repo-package-json/lists"}