{"_id":"@bpmn-io/semver-compat","_rev":"3-c32a01bf8d8acf6aeb88ee723116ff2d","name":"@bpmn-io/semver-compat","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@bpmn-io/semver-compat","version":"0.1.0","author":{"name":"bpmn.io contributors"},"license":"MIT","_id":"@bpmn-io/semver-compat@0.1.0","maintainers":[{"name":"bpmn-io-admin","email":"bpmnio@camunda.com"},{"name":"nikku","email":"git_nikku@nixis.de"},{"name":"barmac","email":"maciejbarel@gmail.com"},{"name":"philippfromme","email":"philippfromme@outlook.com"},{"name":"maxtru","email":"maximilian.trumpf@camunda.com"},{"name":"skaiir-camunda","email":"valentin.serra@camunda.com"},{"name":"vsgoulart","email":"vinicius@vsgoulart.com"},{"name":"barinali","email":"ali.barin53@gmail.com"},{"name":"jarekdanielak","email":"jarek.danielak@camunda.com"},{"name":"ev-camunda","email":"ev.bilske@camunda.com"},{"name":"alekseymanetov","email":"alekseyManetov@gmail.com"}],"homepage":"https://github.com/bpmn-io/semver-compat#readme","bugs":{"url":"https://github.com/bpmn-io/semver-compat/issues"},"dist":{"shasum":"7db7437a4f2b65403b3279502e5fa86be2ebbe5f","tarball":"https://registry.npmjs.org/@bpmn-io/semver-compat/-/semver-compat-0.1.0.tgz","fileCount":5,"integrity":"sha512-hIcW42Ku92MUioL6aknDbRoW1jK8ZEqIe8qZZ+d3cjitDO+PMEFFXj/sezJYIHMe8elu4CBz9qpjkV8WIVG9qw==","signatures":[{"sig":"MEQCIFr4BngwvJPDOiodT9HtioTKzyvag/gDilt00OSDgFMoAiBNHNHKyWTSqspKL3FGctkVcH+hrD8oOR53FChqnUNW+w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":222403},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"35f0ee992818e1170c551df87cb57c074e77d807","scripts":{"all":"run-s lint build check-types test","lint":"eslint .","test":"mocha --recursive test","build":"rollup -c && tsc","prepare":"run-s build","check-types":"tsc --noEmit"},"_npmUser":{"name":"bpmn-io-admin","email":"bpmnio@camunda.com"},"repository":{"url":"git+https://github.com/bpmn-io/semver-compat.git","type":"git"},"_npmVersion":"11.11.0","description":"Check whether provided semver versions satisfy required ranges","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","dependencies":{"semver":"^7.7.2"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^6.2.2","mocha":"^11.0.0","eslint":"^9.0.0","rollup":"^4.0.0","typescript":"^5.0.0","@types/chai":"^5.0.0","@types/mocha":"^10.0.0","npm-run-all2":"^8.0.0","@types/semver":"^7.0.0","eslint-plugin-bpmn-io":"^2.0.0","@rollup/plugin-commonjs":"^29.0.2","@rollup/plugin-node-resolve":"^16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/semver-compat_0.1.0_1778229144763_0.9665591321164233","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-05-08T08:32:24.645Z","modified":"2026-07-08T15:54:15.433Z","0.1.0":"2026-05-08T08:32:24.924Z"},"bugs":{"url":"https://github.com/bpmn-io/semver-compat/issues"},"author":{"name":"bpmn.io contributors"},"license":"MIT","homepage":"https://github.com/bpmn-io/semver-compat#readme","repository":{"url":"git+https://github.com/bpmn-io/semver-compat.git","type":"git"},"description":"Check whether provided semver versions satisfy required ranges","maintainers":[{"email":"bpmnio@camunda.com","name":"bpmn-io-admin"},{"email":"git_nikku@nixis.de","name":"nikku"},{"email":"maciejbarel@gmail.com","name":"barmac"},{"email":"philippfromme@outlook.com","name":"philippfromme"},{"email":"maximilian.trumpf@camunda.com","name":"maxtru"},{"email":"valentin.serra@camunda.com","name":"skaiir-camunda"},{"email":"vinicius@vsgoulart.com","name":"vsgoulart"},{"email":"ali.barin53@gmail.com","name":"barinali"},{"email":"ev.bilske@camunda.com","name":"ev-camunda"},{"email":"jarek.danielak@camunda.com","name":"jarekdanielak"},{"email":"alekseyManetov@gmail.com","name":"alekseymanetov"}],"readme":"# @bpmn-io/semver-compat\n\n[![CI](https://github.com/jarekdanielak/semver-compat/actions/workflows/CI.yml/badge.svg)](https://github.com/jarekdanielak/semver-compat/actions/workflows/CI.yml)\n\nCheck whether provided semver versions satisfy required ranges.\n\n## Installation\n\n```sh\nnpm install @bpmn-io/semver-compat\n```\n\n## Usage\n\n### `isCompatible(required, provided)`\n\nReturns `true` if every entry in `required` is satisfied by the corresponding version in `provided`.\n\n```js\nimport { isCompatible } from '@bpmn-io/semver-compat';\n\nisCompatible(\n  { node: '>=18', npm: '>=9' },  // required\n  { node: '16',   npm: '10'  }   // provided\n); // → false\n\nisCompatible(\n  { node: '>=18', npm: '>=9' },\n  { node: '20',   npm: '10'  }\n); // → true\n```\n\n### Behavior\n\nThe compatibility check **fails open**: when data is missing or unparseable the entry is considered compatible, so misconfiguration never blocks the user unexpectedly.\n\nOnly keys present in both `required` and `provided` are checked:\n\n```js\nisCompatible(\n  { node: '>=18', npm: '>=9' },\n  { node: '20' }               // npm not provided\n); // → true\n```\n\nEntries in `provided` whose value cannot be coerced to semver are skipped (treated as compatible):\n\n```js\nisCompatible(\n  { node: '>=18' },\n  { node: 'not-a-version' }\n); // → true\n```\n\nEntries in `required` with an invalid semver range are skipped (treated as compatible):\n\n```js\nisCompatible(\n  { node: 'not-a-range' },\n  { node: '20' }\n); // → true\n```\n\n| Parameter  | Type            | Description                       |\n|------------|-----------------|-----------------------------------|\n| `required` | `SemverRanges`  | Named semver range requirements   |\n| `provided` | `SemverVersions`| Named version strings to check    |\n\n### `getCompatible(required, provided)`\n\nReturns the subset of `provided` whose versions satisfy the corresponding ranges in `required`.\n\n```js\ngetCompatible(\n  { node: '>=18', npm: '>=9' },  // required\n  { node: '20',   npm: '8'   }   // provided\n); // → { node: '20' }\n```\n\n| Parameter  | Type            | Description                       |\n|------------|-----------------|-----------------------------------|\n| `required` | `SemverRanges`  | Named semver range requirements   |\n| `provided` | `SemverVersions`| Named version strings to check    |\n\n### `getCoerced(versions)`\n\nReturns the subset of `versions` whose values can be coerced to valid semver, normalized to standard semver format. Entries with uncoercible values are omitted.\n\n```js\ngetCoerced(\n  { node: '20', myLib: '18.0.0.Final', broken: 'not-a-version' }\n); // → { node: '20.0.0', myLib: '18.0.0' }\n```\n\n| Parameter  | Type            | Description                       |\n|------------|-----------------|-----------------------------------|\n| `versions` | `SemverVersions`| Named version strings to coerce   |\n\n### `isSatisfied(range, version)`\n\nReturns `true` if the version satisfies the range, `false` if it does not, or `null` if the check should be skipped — when the range is invalid or the version cannot be coerced to semver.\n\n```js\nisSatisfied('>=18', '20');          // → true\nisSatisfied('>=18', '16');          // → false\nisSatisfied('not-a-range', '20');   // → null\nisSatisfied('>=18', 'not-a-version'); // → null\n```\n\n| Parameter | Type     | Description              |\n|-----------|----------|--------------------------|\n| `range`   | `string` | A semver range string    |\n| `version` | `string` | A version string to check |\n\n## License\n\nMIT\n","readmeFilename":"README.md"}