{"id":47821911,"url":"https://github.com/unraid/custom-semver","last_synced_at":"2026-04-03T19:12:27.606Z","repository":{"id":291608735,"uuid":"978167730","full_name":"unraid/custom-semver","owner":"unraid","description":"Custom Semver Parser for Ordering Hotfix Versions of Unraid","archived":false,"fork":false,"pushed_at":"2026-04-01T21:12:59.000Z","size":84,"stargazers_count":0,"open_issues_count":11,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-04-02T08:52:02.318Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@unraid/custom-semver","language":"TypeScript","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/unraid.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-05-05T15:13:54.000Z","updated_at":"2025-05-06T20:29:33.000Z","dependencies_parsed_at":"2026-04-02T04:02:20.095Z","dependency_job_id":null,"html_url":"https://github.com/unraid/custom-semver","commit_stats":null,"previous_names":["unraid/custom-semver"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/unraid/custom-semver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unraid%2Fcustom-semver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unraid%2Fcustom-semver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unraid%2Fcustom-semver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unraid%2Fcustom-semver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unraid","download_url":"https://codeload.github.com/unraid/custom-semver/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unraid%2Fcustom-semver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31372199,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T17:53:18.093Z","status":"ssl_error","status_checked_at":"2026-04-03T17:53:17.617Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-04-03T19:12:26.506Z","updated_at":"2026-04-03T19:12:27.585Z","avatar_url":"https://github.com/unraid.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Custom SemVer\n\nA library for semantic versioning with special handling for patch build tags.\n\n## Installation\n\n```bash\nnpm install custom-semver\n# or\nyarn add custom-semver\n# or\npnpm add custom-semver\n```\n\n### Peer Dependencies\n\nThis package has the following peer dependencies:\n\n```json\n{\n  \"semver\": \"^7.0.0\"\n}\n```\n\nMake sure they are installed in your project.\n\n## Features\n\nThis library extends standard semver comparison to handle build tags in a special way:\n\n- Normal semver comparison is performed first. If versions are equal, then build tags are compared.\n- If at least one version has a build tag containing \"patch\", custom comparison is used:\n  - Build tags are normalized by adding zeros until they have at least 3 parts (like 1.0.0) for proper comparison.\n  - A version with a patch build tag is considered greater than a version without a build tag.\n- If neither version has a build tag containing \"patch\", standard semver comparison is used.\n\n## Usage\n\n```typescript\nimport { customSemverCompare, gt, lt, eq, gte, lte, valid } from 'custom-semver';\n\n// Compare versions\ncustomSemverCompare('1.0.0', '2.0.0'); // returns -1 (1.0.0 \u003c 2.0.0)\ncustomSemverCompare('7.0.0+patch.1', '7.0.0+patch.10'); // returns -1 (7.0.0+patch.1 \u003c 7.0.0+patch.10)\ncustomSemverCompare('7.0.0+patch.1', '7.0.0+patch.1.0'); // returns 0 (they are equal)\n\n// Check if one version is greater than another\ngt('2.0.0', '1.0.0'); // returns true\ngt('7.0.0+patch.10', '7.0.0+patch.1'); // returns true\n\n// Check if one version is less than another\nlt('1.0.0', '2.0.0'); // returns true\nlt('7.0.0+patch.1', '7.0.0+patch.10'); // returns true\n\n// Check if versions are equal\neq('1.0.0', '1.0.0'); // returns true\neq('7.0.0+patch.1', '7.0.0+patch.1.0'); // returns true\n\n// Check if one version is greater than or equal to another\ngte('2.0.0', '1.0.0'); // returns true\ngte('1.0.0', '1.0.0'); // returns true\ngte('7.0.0+patch.10', '7.0.0+patch.1'); // returns true\n\n// Check if one version is less than or equal to another\nlte('1.0.0', '2.0.0'); // returns true\nlte('1.0.0', '1.0.0'); // returns true\nlte('7.0.0+patch.1', '7.0.0+patch.10'); // returns true\n\n// Check if a version string is valid\nvalid('1.0.0'); // returns '1.0.0'\nvalid('invalid'); // returns null\n```\n\n## Examples\n\n```typescript\n// Handling patch build tags\ncustomSemverCompare('7.0.0+patch.1', '7.0.0+patch.10'); // -1\ncustomSemverCompare('7.0.0+patch.10', '7.0.0+patch.1'); // 1\n\n// Comparing versions with and without build tags\ncustomSemverCompare('7.0.0', '7.0.0+patch.1'); // -1\ncustomSemverCompare('7.0.0+patch.1', '7.0.0'); // 1\n\n// Standard semver comparison for non-patch build tags\ncustomSemverCompare('7.0.0+alpha', '7.0.0+beta'); // 0\n```\n\n## License\n\nMIT\n\n## Code Coverage\n\n[![codecov](https://codecov.io/gh/unraid/custom-semver/branch/main/graph/badge.svg)](https://codecov.io/gh/unraid/custom-semver)\n\nThis project uses [Codecov](https://codecov.io/) for code coverage reporting. The badge above shows the current test coverage status.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funraid%2Fcustom-semver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funraid%2Fcustom-semver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funraid%2Fcustom-semver/lists"}