{"id":28357295,"url":"https://github.com/webinstall/webi-build-classifier","last_synced_at":"2025-10-10T10:18:07.634Z","repository":{"id":207438170,"uuid":"718800754","full_name":"webinstall/webi-build-classifier","owner":"webinstall","description":"Determine OS, Vendor, Arch, \u0026 Libc from a filename string.","archived":false,"fork":false,"pushed_at":"2025-02-07T11:27:56.000Z","size":145,"stargazers_count":5,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-19T20:40:42.259Z","etag":null,"topics":["linux","macos","windows","wsl"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webinstall.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":"2023-11-14T20:34:42.000Z","updated_at":"2025-05-19T23:31:34.000Z","dependencies_parsed_at":"2023-11-15T20:31:31.826Z","dependency_job_id":"2f2a4666-6454-45aa-b238-1823667d1fd5","html_url":"https://github.com/webinstall/webi-build-classifier","commit_stats":{"total_commits":27,"total_committers":2,"mean_commits":13.5,"dds":0.03703703703703709,"last_synced_commit":"54843f08f406ff492dba2f463b716d339d0a0460"},"previous_names":["webinstall/webi-build-classifier"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/webinstall/webi-build-classifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webinstall%2Fwebi-build-classifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webinstall%2Fwebi-build-classifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webinstall%2Fwebi-build-classifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webinstall%2Fwebi-build-classifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webinstall","download_url":"https://codeload.github.com/webinstall/webi-build-classifier/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webinstall%2Fwebi-build-classifier/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003501,"owners_count":26083594,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"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":["linux","macos","windows","wsl"],"created_at":"2025-05-28T07:30:32.026Z","updated_at":"2025-10-10T10:18:07.629Z","avatar_url":"https://github.com/webinstall.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Webi's Host \u0026 Asset Target Triplet Classifier\n\nDetermine Host Target Triplet (Arch, Libc, OS, Vendor) from a filenames /\ndownload URL and uname / User-Agent strings.\n\nAlso compares versions lexicographically.\n\n```json\n{\n  \"arch\": \"aarch64\",\n  \"os\": \"linux\",\n  \"libc\": \"none\",\n  \"vendor\": \"unknown\",\n  \"unknownTerms\": [\"infra\"]\n}\n```\n\n## Table of Contents\n\n- All Targets\n- Host to Target (`uname` to triplet)\n- Lexicographical Versions\n- Build to Target (_filename_ to triplet)\n\n## All Target Options\n\n```json\n{\n  \"arches\": [\n    \"\",\n    \"ANYARCH\",\n    \"POSIX\",\n    \"aarch64\",\n    \"armel\",\n    \"armhf\",\n    \"armv6\",\n    \"armv7\",\n    \"armv7a\",\n    \"loong64\",\n    \"mips\",\n    \"mips64\",\n    \"mips64el\",\n    \"mips64r6\",\n    \"mips64r6el\",\n    \"mipsel\",\n    \"mipsr6\",\n    \"mipsr6el\",\n    \"ppc\",\n    \"ppc64\",\n    \"ppc64le\",\n    \"riscv64\",\n    \"s390x\",\n    \"wasm32\",\n    \"x86\",\n    \"x86_64\",\n    \"x86_64_v2\",\n    \"x86_64_v3\",\n    \"x86_64_v4\",\n    \"x86_64_rocm\"\n  ],\n  \"oses\": [\n    \"\",\n    \"ANYOS\",\n    \"posix_2017\",\n    \"posix_2024\",\n    \"aix\",\n    \"android\",\n    \"darwin\",\n    \"dragonfly\",\n    \"freebsd\",\n    \"illumos\",\n    \"linux\",\n    \"netbsd\",\n    \"openbsd\",\n    \"plan9\",\n    \"solaris\",\n    \"sunos\",\n    \"wasi\",\n    \"windows\"\n  ],\n  \"libcs\": [\"\", \"ANYLIBC\", \"none\", \"bionic\", \"gnu\", \"libc\", \"msvc\", \"musl\"],\n  \"vendors\": [\"\", \"ANYVENDOR\", \"apple\", \"pc\", \"unknown\"]\n}\n```\n\n## `require('./build_classifier/host-targets.js')`\n\n```text\nHostTargets.termsToTarget(target, terms)\n// Example:\n// { arch: 'x86_64', os: 'linux', libc: 'musl' }\n```\n\n**Don't rely on these** as part of the API, but they're available to inspect.\n\n(they're used for matching _uname_ and _User-Agent_ values to target triplets)\n\n```text\nHostTargets.WATERFALL // { darwin: { aarch64: ['aarch64', 'x86_64'] } }\nHostTargets.TERMS     // { amd64: { arch: 'x86_64' } }\n```\n\n## `require('./build_classifier/lexver.js')`\n\nTurns versions in just about any format into a Lexicographically Sorted version.\n\n```text\nLexver.matchSorted(versions, prefix)  // v1 =\u003e v0001 matches v0001.0000.0000@\nLexver.toTags(lexvers)                // sorts and calls sortedToTags\nLexver.sortedToTags(descLexvers)      // gets { latest, stable, default }\nLexver.parseVersion(fullVersion)      // 'v1-beta1' =\u003e 'v0001.0000.0000-beta-0001'\nLexver.parsePrefix(version)           // v1 =\u003e v0001\n```\n\n## `require('./build_classifier/triplet.js')`\n\nTurns a filename or URL, along with project and release info, into a target\ntriplet.\n\n```text\nTriplet.maybeInstallable(proj, build);    // exclude non-build assets\nTriplet.toPattern(proj, build);           // foo-1.0.0-mac64 =\u003e {NAME}-{VER}-mac64\nTriplet.patternToTerms(filename);         // {NAME}-mac-x86.64 =\u003e [ 'mac', 'x86_64' ]\nTriplet.termsToTarget(\n    target, proj, build, terms            // =\u003e 'x86_64_v2-pc-windows-msvc'\n);\nTriplet.buildToPackageType(build);        // uses 'build.name' or 'build.download'\nTriplet.filenameToPackageType(filename);  // ex: '.zip', '.app.zip', '.tar.gz', ''\n```\n\n**Don't rely on these** as part of the API, but they're available to inspect.\n\n(they're used for excluding and classifying release assets)\n\n```text\nTriplet.TERMS_CHANNEL              // [ 'master', 'nightly', '...' ]\nTriplet.TERMS_CHECKSUM             // [ 'MD5SUMS', 'SHA1SUMS', '...' ]\nTriplet.TERMS_EXTS_NON_BUILD       // [ '.asc', '.json', '.sha1', '...' ]\nTriplet.TERMS_EXTS_NON_INFORMATIVE // [ '.gz', '.zip', '...', '.tar' ]\nTriplet.TERMS_EXTS_PKG             // [ '.exe', '.tar', '.dmg', '...' ]\nTriplet.TERMS_EXTS_SOURCE          // [ '.zip', '.tar.gz', '...' ]\nTriplet.TERMS_EXTS_ZIP             // [ '.gz', '.xz', '.zip', '...' ]\nTriplet.TERMS_NON_BUILD            // [ 'debug', 'src', 'vendor', '...' ]\nTriplet.TERMS_PRIMARY_MAP          // { 'APPLE_AARCH64': { /* ... */ } }\nTriplet.TERMS_TIERED_MAPS          // [ { 'gnu': { os: 'windows' } ]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebinstall%2Fwebi-build-classifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebinstall%2Fwebi-build-classifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebinstall%2Fwebi-build-classifier/lists"}