{"id":20597105,"url":"https://github.com/tradle/lexicographic-semver","last_synced_at":"2026-04-27T05:01:25.109Z","repository":{"id":66294709,"uuid":"142913522","full_name":"tradle/lexicographic-semver","owner":"tradle","description":null,"archived":false,"fork":false,"pushed_at":"2018-07-30T18:39:54.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-14T13:16:01.773Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/tradle.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2018-07-30T18:30:23.000Z","updated_at":"2020-12-23T10:04:42.000Z","dependencies_parsed_at":"2023-02-21T06:16:14.302Z","dependency_job_id":null,"html_url":"https://github.com/tradle/lexicographic-semver","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/tradle/lexicographic-semver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Flexicographic-semver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Flexicographic-semver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Flexicographic-semver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Flexicographic-semver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tradle","download_url":"https://codeload.github.com/tradle/lexicographic-semver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Flexicographic-semver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32323215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2024-11-16T08:20:20.681Z","updated_at":"2026-04-27T05:01:24.946Z","avatar_url":"https://github.com/tradle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lexicographic-semver\n\nconvert semver tag to lexicographically sortable string, sort, compare, validate\n\nyes, there are many libraries that compare/sort semver versions, but I haven't found one that converts semver versions to lexicographically sortable strings, which is a convenient way to store them in sorted order in a database.\n\nNote: this library supports a limited subset of semver versions, e.g. `1.2.3-alpha.0` is allowed but `1.2.3-alpha` is not.\n\n## Install\n\n```sh\nnpm i -S lexicographic-semver\n```\n\n## Usage\n\n```js\nconst semverSort = require('lexicographic-semver')\nsemverSort.sortTags(['1.2.3', '1.2.1', '1.2.2-rc.0'])\n// [ '1.2.1', '1.2.2-rc.0', '1.2.3' ]\n\nsemverSort.toSortableTag('v1.2.3')\n// '01.02.03~'\nsemverSort.toSortableTag('v1.2.3-rc.0')\n// '01.02.03-rc.00'\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftradle%2Flexicographic-semver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftradle%2Flexicographic-semver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftradle%2Flexicographic-semver/lists"}