{"id":16486178,"url":"https://github.com/xsc/version-clj","last_synced_at":"2025-04-09T16:20:08.603Z","repository":{"id":9214943,"uuid":"11027513","full_name":"xsc/version-clj","owner":"xsc","description":"Version Number Analysis and Comparison for Clojure(Script) | Moved to Codeberg","archived":true,"fork":false,"pushed_at":"2024-08-20T10:04:37.000Z","size":75,"stargazers_count":43,"open_issues_count":2,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T16:20:04.446Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://codeberg.org/xsc/version-clj","language":"Clojure","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/xsc.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},"funding":{"github":["xsc"],"open_collective":"xsc-clojure"}},"created_at":"2013-06-28T13:54:45.000Z","updated_at":"2025-01-20T11:03:56.000Z","dependencies_parsed_at":"2024-11-06T05:34:12.023Z","dependency_job_id":"8f843a66-91a9-4b6b-97f2-cbc8f7be2f66","html_url":"https://github.com/xsc/version-clj","commit_stats":{"total_commits":69,"total_committers":7,"mean_commits":9.857142857142858,"dds":0.5217391304347826,"last_synced_commit":"32ef8ae7b0640d9bfbbbc17db7c6f48858038ccb"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xsc%2Fversion-clj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xsc%2Fversion-clj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xsc%2Fversion-clj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xsc%2Fversion-clj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xsc","download_url":"https://codeload.github.com/xsc/version-clj/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065281,"owners_count":21041872,"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":[],"created_at":"2024-10-11T13:28:35.612Z","updated_at":"2025-04-09T16:20:08.575Z","avatar_url":"https://github.com/xsc.png","language":"Clojure","funding_links":["https://github.com/sponsors/xsc","https://opencollective.com/xsc-clojure"],"categories":[],"sub_categories":[],"readme":"# version-clj\n\n[![clojars](https://img.shields.io/clojars/v/version-clj.svg)](https://clojars.org/version-clj)\n[![Documentation](https://cljdoc.org/badge/version-clj/version-clj)](https://cljdoc.org/d/version-clj/version-clj/CURRENT)\n![CI](https://github.com/xsc/version-clj/workflows/CI/badge.svg?branch=master)\n[![codecov](https://codecov.io/gh/xsc/version-clj/branch/master/graph/badge.svg?token=xmrXrhA6Z7)](https://codecov.io/gh/xsc/version-clj)\n[![bb compatible](https://raw.githubusercontent.com/babashka/babashka/master/logo/badge.svg)](https://babashka.org)\n\n__version-clj__ is a Clojure \u0026amp; ClojureScript library for analysis and\ncomparison of artifact version numbers. It originated as a comparison mechanism\nin [lein-ancient][], a plugin to detect outdated dependencies in your packages.\n\n[lein-ancient]: https://github.com/xsc/lein-ancient\n\n## Usage\n\n```clojure\n(require '[version-clj.core :as v])\n```\n\n### Comparison\n\n```clojure\n(v/older? \"1.0.0-alpha\" \"1.0.0\")     ;; =\u003e true\n(v/newer? \"1.0.0-rc2\" \"1.0.0-rc1\")   ;; =\u003e true\n(v/version-compare \"1.0.0\" \"0.9.0\")  ;; =\u003e 1\n```\n\n### Sorting\n\n```clojure\n(v/version-sort [\"1.0.0-alpha\", \"1.0.0\", \"1.0.0-SNAPSHOT\", \"0.9.0-RC1\"])\n;; =\u003e (\"0.9.0-RC1\" \"1.0.0-alpha\" \"1.0.0-SNAPSHOT\" \"1.0.0\")\n```\n\n### Analysis\n\n```clojure\n(v/parse \"1.0.0-rc-snapshot\")\n;; =\u003e {:version [(1 0 0) (\"rc\" \"snapshot\")],\n;;     :qualifiers #{\"rc\" \"snapshot\"},\n;;     :snapshot? true,\n;;     :qualified? true}\n\n(v/snapshot? \"1.0.0\")\n;; =\u003e false\n\n(v/qualified? \"1.0.0-rc\")\n;; =\u003e true\n```\n\n## Comparison Rules\n\nVersion seqs are compared by extending them to the same length (using zero/nil)\nfollowed by an element-wise comparison.\n\n- Integers are compared numerically.\n- Strings are compared using a table of well-known qualifiers or lexicographically.\n- A well-known qualifier is newer than an unknown one.\n- Subsequences are compared like they represent versions of their own.\n- An integer is newer than a string.\n\nThe order of well-known qualifiers is case-insensitive and given as:\n\n```clojure\n  \"alpha\"     == \"a\"\n\u003c \"beta\"      == \"b\"\n\u003c \"milestone\" == \"m\"\n\u003c \"rc\"        == \"cr\"\n\u003c \"snapshot\"\n\u003c \"final\"     == \"stable\" == \"\"\n```\n\nHave a look at the [respective unit tests][compare-test] to see the comparison\nmechanism in action.\n\n[compare-test]: https://github.com/xsc/version-clj/blob/master/test/version_clj/compare_test.cljc\n\n## License\n\n```\nMIT License\n\nCopyright (c) 2013-2021 Yannick Scherer\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxsc%2Fversion-clj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxsc%2Fversion-clj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxsc%2Fversion-clj/lists"}