{"id":26905166,"url":"https://github.com/jimdo/package-adoption","last_synced_at":"2025-04-01T10:56:21.267Z","repository":{"id":62153790,"uuid":"536040026","full_name":"Jimdo/package-adoption","owner":"Jimdo","description":"Find out where a js package is used across a GitHub organization, its version and position in each repository","archived":false,"fork":false,"pushed_at":"2024-10-24T07:10:40.000Z","size":1418,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-10-25T02:16:07.279Z","etag":null,"topics":["github-api","hacktoberfest","owner-ux-platform","stats","usage"],"latest_commit_sha":null,"homepage":"","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/Jimdo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-13T08:56:19.000Z","updated_at":"2024-10-24T07:09:33.000Z","dependencies_parsed_at":"2024-06-25T14:09:22.267Z","dependency_job_id":"1b366912-d780-4f6e-be4a-d7d792e20472","html_url":"https://github.com/Jimdo/package-adoption","commit_stats":{"total_commits":165,"total_committers":4,"mean_commits":41.25,"dds":"0.21212121212121215","last_synced_commit":"408e48f3cd367a4ba7235bf566b8ce60612dae52"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":"ryansonshine/typescript-npm-package-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jimdo%2Fpackage-adoption","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jimdo%2Fpackage-adoption/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jimdo%2Fpackage-adoption/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jimdo%2Fpackage-adoption/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jimdo","download_url":"https://codeload.github.com/Jimdo/package-adoption/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246628271,"owners_count":20808106,"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":["github-api","hacktoberfest","owner-ux-platform","stats","usage"],"created_at":"2025-04-01T10:56:20.611Z","updated_at":"2025-04-01T10:56:21.261Z","avatar_url":"https://github.com/Jimdo.png","language":"TypeScript","readme":"# package-adoption\n\n[![npm package][npm-img]][npm-url]\n[![Build Status][build-img]][build-url]\n[![Downloads][downloads-img]][downloads-url]\n[![Issues][issues-img]][issues-url]\n[![Commitizen Friendly][commitizen-img]][commitizen-url]\n\n[Find out where a ts/js package is used](https://medium.com/p/caabc3a7544c) across a GitHub organization, version and position of the package for each repository.\n\nUsage for `pkgName` will be analyzed across `org`, excluding repositories that did not receive any commit in the last `daysUntilStale` days. A GitHub [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) with scope `repo` is required, to access the `org` **private repositories** through GitHub APIs. It can be omitted to search across public repositories.\nArchived repositories are filtered out.\n\n\u003e [!WARNING]\n\u003e GitHub API are rate limited, and search API in particular has the additional [secondary rate limit](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#secondary-rate-limits). _package-adoption_ implements the [best practices guidelines](https://docs.github.com/en/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits) to deal with it, but you should know that limitations could happen in any case.\n\n\u003e [!CAUTION]\n\u003e GitHub search API are not 100% reliable and sometimes return deleted / outdated files or multiple versions of the same file. The library version in the output could be inaccurate for this reason.\n\n## Install\n\n```bash\nnpm install package-adoption\n```\n\n## Usage\n\n```ts\nimport { getFilteredReposWithPackageForOrg } from 'package-adoption';\n\nconst result = getFilteredReposWithPackageForOrg({\n  org: 'my-org',\n  daysUntilStale: 90,\n  ghAuthToken: 'my-gh-auth-token',\n  pkgName: 'my-pkg',\n});\n/* =\u003e [\n  {\n    name: 'repo-1',\n    installationPath: 'root',\n    libVersion: '55.0.0-beta.13',\n  },\n  {\n    name: 'repo-2',\n    installationPath: 'packages/package-name1',\n    libVersion: '65.2.0',\n    \"isPeerDep\": true,\n    \"isDevDep\": true\n  },\n  {\n    name: 'repo-2',\n    installationPath: 'packages/package-name2',\n    libVersion: '65.2.1',\n    \"isDevDep\": true\n  }\n]; */\n```\n\n## Run CLI\n\n```bash\nnpx package-adoption\n\npackage-adoption --config /path/to/config.json --output /path/to/output.json\n```\n\nIf output file path omitted, `package-adoption` outputs to stdout.\nWhen config option omitted, default for config file will be local `config.json`. The file must export an object like this:\n\n```json\n{\n  \"org\": \"myOrg\",\n  \"daysUntilStale\": 90, // If omitted, 365 will be used as default\n  \"ghAuthToken\": \"my-GH-auth-token\",\n  \"pkgName\": \"myPkg\"\n}\n```\n\n### With inline arguments\n\n```bash\npackage-adoption --org=myOrg --token=my-GH-auth-token --pkg=myPkg --output /path/to/output.json\n```\n\n### Run locally\n\n```bash\nnpm run dev\n```\n\n[build-img]: https://github.com/jimdo/package-adoption/actions/workflows/release.yml/badge.svg\n[build-url]: https://github.com/jimdo/package-adoption/actions/workflows/release.yml\n[downloads-img]: https://img.shields.io/npm/dt/package-adoption\n[downloads-url]: https://www.npmtrends.com/package-adoption\n[npm-img]: https://img.shields.io/npm/v/package-adoption\n[npm-url]: https://www.npmjs.com/package/package-adoption\n[issues-img]: https://img.shields.io/github/issues/jimdo/package-adoption\n[issues-url]: https://github.com/jimdo/package-adoption/issues\n[commitizen-img]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg\n[commitizen-url]: http://commitizen.github.io/cz-cli/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimdo%2Fpackage-adoption","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimdo%2Fpackage-adoption","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimdo%2Fpackage-adoption/lists"}