{"id":15022215,"url":"https://github.com/ext/npm-min-peer","last_synced_at":"2026-06-10T02:00:33.955Z","repository":{"id":38103329,"uuid":"489684466","full_name":"ext/npm-min-peer","owner":"ext","description":"Get minimum version required by a peerDependency","archived":false,"fork":false,"pushed_at":"2026-06-02T06:35:10.000Z","size":4998,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-06-02T08:22:49.005Z","etag":null,"topics":["build","ci","github-actions","hacktoberfest","npm"],"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/ext.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"ext"}},"created_at":"2022-05-07T13:42:58.000Z","updated_at":"2026-05-31T05:47:55.000Z","dependencies_parsed_at":"2026-02-07T04:02:12.039Z","dependency_job_id":null,"html_url":"https://github.com/ext/npm-min-peer","commit_stats":{"total_commits":647,"total_committers":5,"mean_commits":129.4,"dds":"0.11128284389489951","last_synced_commit":"f949b509194ffaf0cf1c00e427931a56860c73e9"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/ext/npm-min-peer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ext%2Fnpm-min-peer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ext%2Fnpm-min-peer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ext%2Fnpm-min-peer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ext%2Fnpm-min-peer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ext","download_url":"https://codeload.github.com/ext/npm-min-peer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ext%2Fnpm-min-peer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34133404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["build","ci","github-actions","hacktoberfest","npm"],"created_at":"2024-09-24T19:57:39.345Z","updated_at":"2026-06-10T02:00:33.929Z","avatar_url":"https://github.com/ext.png","language":"TypeScript","funding_links":["https://github.com/sponsors/ext"],"categories":[],"sub_categories":[],"readme":"# `npm-min-peer`\n\n[![Build](https://github.com/ext/npm-min-peer/workflows/Build/badge.svg)](https://github.com/ext/min-min-peer/actions?query=workflow%3ABuild)\n[![Coverage Status](https://coveralls.io/repos/github/ext/npm-min-peer/badge.svg?branch=master)](https://coveralls.io/github/ext/min-min-peer?branch=master)\n\nGet minimum version required by a peerDependency.\n\nThis is typically useful when running a matrix CI pipeline when you want to test all supported versions of a dependency.\n\n## Usage\n\n\u003e npx min-min-peer PACKAGE [--help] [--version] [--major MAJOR] [--with-name]\n\nUse `--help` to see full usage help.\n\nUse `--version` to see package version.\n\nUse `--major` to specify which major version to use when finding the minumum.\nMajor can be specified using any of the following formats:\n\n- `1`\n- `\"1\"`\n- `\"1.x\"`\n- `\"v1\"`\n- `\"v1.x\"`\n\nUse `--with-name` to include the package name in output.\n\nThe exit code will be non-zero if the major is not supported or the package is not found.\n\nGiven a `package.json` like:\n\n```json\n{\n  \"name\": \"my-fancy-package\",\n  \"version\": \"1.2.3\",\n  \"peerDependency\": {\n    \"my-fancy-dependency\": \"^3.4.5 || \u003e= 4.0.0\"\n  }\n}\n```\n\nthe output from the tool will be:\n\n```\n$ npx npm-min-peer my-fancy-dependency\n3.4.5\n$ npx npm-min-peer my-fancy-dependency --major 3\n3.4.5\n$ npx npm-min-peer my-fancy-dependency --major 4 --with-name\nmy-fancy-dependency@4.0.0\n```\n\n### Usage with Github Actions\n\n```yaml\njobs:\n  build:\n    strategy:\n      matrix:\n        version: [3, 4, 5]\n    steps:\n      - name: Install dependencies\n        run: npm ci\n      - name: Install my-fancy-dependency v${{ matrix.version }}\n        run: npm install --no-save $(npx -y npm-min-peer my-fancy-dependency --major ${{ matrix.version }} --with-name)\n      - name: Run tests\n        run: npm test\n```\n\n### Usage with Gitlab CI\n\n```yaml\nmy-fancy-dependency:\n  parallel:\n    matrix:\n      - VERSION: [3, 4, 5]\n  before_script:\n    - npm ci\n    - npm install --no-save $(npx -y npm-min-peer my-fancy-dependency --major ${VERSION} --with-name)\n  script:\n    - npm test\n```\n\n## API\n\nThis can also be used with an API:\n\n```ts\nimport { getMinPeer } from \"npm-min-peer\";\n\nconsole.log(await getMinPeer(\"my-fancy-dependency\")); // \u003e 3.4.5\nconsole.log(await getMinPeer(\"my-fancy-dependency\", { major: 4, withName: true })); // \u003e my-fancy-dependency@4.0.0\n```\n\n### `getMinPeer(pkgName: string, options?: Options): Promise\u003cstring\u003e`\n\n- `pkgName` - name of the `peerDependency` to get version for.\n- `options.major` - Major version (corresponding to `--major`)\n- `options.withName` - Include name in output (corresponding to `--with-name`)\n- `options.pkgFile` - Path to `package.json` to read (default: find closest `package.json` by traversing filesystem).\n\nReturns promise resolved with package version or rejected if the package could not be found or does not match the given major version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fext%2Fnpm-min-peer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fext%2Fnpm-min-peer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fext%2Fnpm-min-peer/lists"}