{"id":16843196,"url":"https://github.com/jbowes/semver","last_synced_at":"2025-04-11T05:53:08.287Z","repository":{"id":39750193,"uuid":"400270761","full_name":"jbowes/semver","owner":"jbowes","description":"🦔 semver and constraint parsing with a focus on performance","archived":false,"fork":false,"pushed_at":"2023-12-07T12:55:39.000Z","size":84,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T05:53:03.240Z","etag":null,"topics":["go","golang","hacktoberfest","parser","ragel","semver","semver-parser"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jbowes.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":"2021-08-26T18:37:19.000Z","updated_at":"2024-03-20T13:54:04.000Z","dependencies_parsed_at":"2023-02-06T01:16:33.741Z","dependency_job_id":"a526eb3f-490f-447a-af18-67751228c0e0","html_url":"https://github.com/jbowes/semver","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbowes%2Fsemver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbowes%2Fsemver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbowes%2Fsemver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbowes%2Fsemver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jbowes","download_url":"https://codeload.github.com/jbowes/semver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248351407,"owners_count":21089271,"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":["go","golang","hacktoberfest","parser","ragel","semver","semver-parser"],"created_at":"2024-10-13T12:49:56.300Z","updated_at":"2025-04-11T05:53:08.258Z","avatar_url":"https://github.com/jbowes.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n  Attractive html formatting for rendering in github. sorry text editor\n  readers! Besides the header and section links, everything should be clean and\n  readable.\n--\u003e\n\u003ch1 align=\"center\"\u003esemver\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\u003ci\u003e🦔 semver and constraint parsing with a focus on performance\u003c/i\u003e\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://pkg.go.dev/github.com/jbowes/semver\"\u003e\u003cimg src=\"https://pkg.go.dev/badge/github.com/jbowes/semver.svg\" alt=\"Go Reference\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/jbowes/semver/releases/latest\"\u003e\u003cimg alt=\"GitHub tag\" src=\"https://img.shields.io/github/tag/jbowes/semver.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/jbowes/semver/actions/workflows/go.yml\"\u003e\u003cimg alt=\"Build Status\" src=\"https://github.com/jbowes/semver/actions/workflows/go.yml/badge.svg?branch=main\"\u003e\u003c/a\u003e\n  \u003ca href=\"./LICENSE\"\u003e\u003cimg alt=\"BSD license\" src=\"https://img.shields.io/badge/license-BSD-blue.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/jbowes/semver\"\u003e\u003cimg alt=\"codecov\" src=\"https://img.shields.io/codecov/c/github/jbowes/semver.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://goreportcard.com/report/github.com/jbowes/semver\"\u003e\u003cimg alt=\"Go Report Card\" src=\"https://goreportcard.com/badge/github.com/jbowes/semver\"\u003e\u003c/a\u003e\n\u003c/div\u003e\u003cbr /\u003e\u003cbr /\u003e\n\n---\n\n[`semver`][godoc] provides semantic version and constraint parsing, comparison,\nand testing.\n\nThere are many semver packages. This one aims to be the fastest at parsing\nand comparing values, with low memory usage. On average, this package is roughly\nten times faster at parsing versions and constraints than the popular\n`Masterminds/semver`  and `hashicorp/go-version` packages. View more stats in\nthe [benchmarks][bench].\n\nVersions can be compared with one another to determine which is newer.\nConstraints specify inclusions and exclusions of semver ranges that a given\nversion must satisfy. Typically, constraints are used when expressing a\ndependency.\n\n## Quick start\n\n```go\nimport (\n  \"log\"\n\n  \"github.com/jbowes/semver\"\n)\n\nfunc main() {\n  // Parse a version. Two versions can also be Compare()ed\n  ver, err := semver.Parse(\"1.0.2\")\n  if err != nil {\n    log.Fatal(\"invalid semver\")\n  }\n\n  // Parse a Constraint, typically used to express dependency\n  constr, err := semver.ParseConstraint(\"\u003e=1.0.0\")\n  if err != nil {\n    log.Fatalln(\"invalid constraint\")\n  }\n\n  // Check if a Version satisfies a Constraint\n  if constr.Check(ver) {\n    log.Printf(\"%s satisfies constraint %s\\n\", ver, constr)\n  } else {\n    log.Printf(\"%s does not satisfy constraint %s\\n\", ver, constr)\n  }\n}\n```\n\nFor more usage and examples, see the [GoDoc Reference][godoc]\n\n## Contributing\n\nI would love your help!\n\n`semver` is still a work in progress. You can help by:\n\n- Opening a pull request to resolve an [open issue][issues].\n- Adding a feature or enhancement of your own! If it might be big, please\n  [open an issue][enhancement] first so we can discuss it.\n- Improving this `README` or adding other documentation to `semver`.\n- Letting [me] know if you're using `semver`.\n\n## Links\n\n- [Semantic Versioning 2.0.0][semver]\n- [npm semver calculator][calc]\n- [npm semver range BNF][npmbnf]\n- [Benchmarks][bench]\n\n[semver]: https://semver.org\n[calc]: https://semver.npmjs.com/\n[npmbnf]: https://github.com/npm/node-semver/blob/master/range.bnf\n[bench]: https://github.com/jbowes/semver/blob/main/BENCHMARK.md\n\n[godoc]: https://pkg.go.dev/github.com/jbowes/semver\n\n[issues]: ./issues\n[bug]: ./issues/new?labels=bug\n[enhancement]: ./issues/new?labels=enhancement\n\n[me]: https://twitter.com/jrbowes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbowes%2Fsemver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbowes%2Fsemver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbowes%2Fsemver/lists"}