{"name":"bare-semver","version":"1.0.2","author":{"name":"Holepunch"},"license":"Apache-2.0","_id":"bare-semver@1.0.2","maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"},{"name":"kasperisager","email":"kasperisager@hey.com"}],"homepage":"https://github.com/holepunchto/bare-semver#readme","bugs":{"url":"https://github.com/holepunchto/bare-semver/issues"},"dist":{"shasum":"3cfc47ed5d3e809b369daec534ce916b70b83b8c","tarball":"http://registry-npm.ywwl.com/bare-semver/download/bare-semver-1.0.2.tgz","fileCount":10,"integrity":"sha512-ESVaN2nzWhcI5tf3Zzcq9aqCZ676VWzqw07eEZ0qxAcEOAFYBa0pWq8sK34OQeHLY3JsfKXZS9mDyzyxGjeLzA==","signatures":[{"sig":"MEUCIGRQxuRxsUjCirxi7tLIiHj1QpPpGAumrSbb37Sql/Z0AiEA8k0YqSrH8kbjDGvFoDahmR4zINFUQm83W6SJeoI+Zpc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21942,"size":7058,"noattachment":false,"key":"/bare-semver/-/bare-semver-1.0.2.tgz"},"types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js"},"./range":"./lib/range.js","./errors":"./lib/errors.js","./package":"./package.json","./version":"./lib/version.js","./constants":"./lib/constants.js","./comparator":"./lib/comparator.js"},"gitHead":"50783c46b75482288b17a96b75306f935dc8aa4e","scripts":{"test":"prettier . --check && bare test.js"},"_npmUser":{"name":"kasperisager","email":"kasperisager@hey.com"},"repository":{"url":"git+https://github.com/holepunchto/bare-semver.git","type":"git"},"_npmVersion":"11.6.1","description":"Minimal semantic versioning library for Bare","directories":{},"_nodeVersion":"24.8.0","_hasShrinkwrap":false,"devDependencies":{"brittle":"^3.2.1","prettier":"^3.4.2","prettier-config-standard":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/bare-semver_1.0.2_1761223821464_0.3540239454499552","host":"s3://npm-registry-packages-npm-production"},"readme":"# bare-semver\n\nMinimal semantic versioning library for Bare.\n\n```\nnpm i bare-semver\n```\n\n## Usage\n\n```js\nconst semver = require('bare-semver')\n\nconst version = semver.Version.parse('1.2.3-alpha.1+build.42')\n\nconsole.log(version.major) // 1\nconsole.log(version.minor) // 2\nconsole.log(version.patch) // 3\n\nconst satisfied = semver.satisfies('1.2.3', '>=1.0.0 <2.0.0')\n\nconsole.log(satisfied) // true\n```\n\n## API\n\n#### `const satisfied = semver.satisfies(version, range)`\n\nTest whether `version` satisfies `range`. Both `version` and `range` may be strings, in which case they will be parsed.\n\n#### `semver.constants`\n\nAn object containing the comparison operator constants:\n\n```js\nconstants = {\n  EQ: 1,\n  LT: 2,\n  LTE: 3,\n  GT: 4,\n  GTE: 5\n}\n```\n\n#### `semver.errors`\n\nThe `SemVerError` class. Thrown when parsing invalid versions or ranges.\n\n#### `const version = new semver.Version(major, minor, patch[, options])`\n\nCreate a new version with the given `major`, `minor`, and `patch` components.\n\nOptions include:\n\n```js\noptions = {\n  prerelease: [],\n  build: []\n}\n```\n\n#### `version.major`\n\nThe major version number.\n\n#### `version.minor`\n\nThe minor version number.\n\n#### `version.patch`\n\nThe patch version number.\n\n#### `version.prerelease`\n\nAn array of prerelease tags.\n\n#### `version.build`\n\nAn array of build metadata tags.\n\n#### `const result = version.compare(other)`\n\nCompare `version` with `other`, returning `1` if `version` is greater, `-1` if less, or `0` if equal. Comparison follows the Semantic Versioning 2.0.0 specification, including prerelease precedence rules.\n\n#### `const string = version.toString()`\n\nReturn the string representation of `version`.\n\n#### `const version = semver.Version.parse(input)`\n\nParse a semantic version string into a `Version` instance. Throws a `SemVerError` with code `INVALID_VERSION` if `input` is not a valid version string.\n\n#### `const result = semver.Version.compare(a, b)`\n\nCompare two `Version` instances, returning `1`, `-1`, or `0`.\n\n#### `const comparator = new semver.Comparator(operator, version)`\n\nCreate a new comparator with the given `operator` constant and `version`.\n\n#### `comparator.operator`\n\nThe comparison operator constant.\n\n#### `comparator.version`\n\nThe `Version` instance to compare against.\n\n#### `const satisfied = comparator.test(version)`\n\nTest whether `version` satisfies the comparator.\n\n#### `const string = comparator.toString()`\n\nReturn the string representation of the comparator, e.g. `>=1.0.0`.\n\n#### `const range = new semver.Range([comparators])`\n\nCreate a new range from a two-dimensional array of `Comparator` instances. Each inner array represents a set of comparators joined by intersection, and the outer array represents the union of those sets.\n\n#### `range.comparators`\n\nThe two-dimensional array of `Comparator` instances.\n\n#### `const satisfied = range.test(version)`\n\nTest whether `version` satisfies the range.\n\n#### `const string = range.toString()`\n\nReturn the string representation of the range.\n\n#### `const range = semver.Range.parse(input)`\n\nParse a range string into a `Range` instance. Supports the following syntax, which is desugared into sets of comparators following the [npm advanced range syntax](https://www.npmjs.com/package/semver#advanced-range-syntax):\n\n- Comparison operators: `<`, `<=`, `>`, `>=`, `=`, e.g. `>=1.2.3`.\n- Logical OR of comparator sets: `||`, e.g. `1.2.3 || >=2.0.0`.\n- Caret ranges: `^1.2.3` allows changes that do not modify the left-most non-zero component, e.g. `^1.2.3` is `>=1.2.3 <2.0.0-0` and `^0.2.3` is `>=0.2.3 <0.3.0-0`.\n- Tilde ranges: `~1.2.3` allows patch-level changes if a minor version is specified and minor-level changes if not, e.g. `~1.2.3` is `>=1.2.3 <1.3.0-0` and `~1` is `>=1.0.0 <2.0.0-0`. `~>` is accepted as an alias for `~`.\n- X-ranges: `x`, `X`, or `*` stand in for a component, e.g. `1.2.x` is `>=1.2.0 <1.3.0-0` and `*` is `>=0.0.0`. Partial versions such as `1` and `1.2` are treated as X-ranges.\n- Hyphen ranges: `1.2.3 - 2.3.4` specifies an inclusive set, expanding to `>=1.2.3 <=2.3.4`. A partial upper bound caps the range, e.g. `1.2.3 - 2.3` is `>=1.2.3 <2.4.0-0`.\n\n## License\n\nApache-2.0\n","publish_time":1761223821675,"_cnpm_publish_time":1761223821675,"dist-tags":{"latest":"1.1.0"}}