{"id":23241582,"url":"https://github.com/rhysforyou/superhighway","last_synced_at":"2025-08-20T01:32:40.642Z","repository":{"id":59113884,"uuid":"210090375","full_name":"rhysforyou/Superhighway","owner":"rhysforyou","description":"As big a networking library as you'll need","archived":false,"fork":false,"pushed_at":"2023-07-17T00:50:58.000Z","size":97,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-15T10:48:27.513Z","etag":null,"topics":["combine","ios","macos","networking","spm","swift","swift-concurrency","swift-package-manager","tvos","watchos"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rhysforyou.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-22T04:29:27.000Z","updated_at":"2025-08-10T10:02:13.000Z","dependencies_parsed_at":"2022-09-12T14:53:09.088Z","dependency_job_id":null,"html_url":"https://github.com/rhysforyou/Superhighway","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/rhysforyou/Superhighway","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysforyou%2FSuperhighway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysforyou%2FSuperhighway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysforyou%2FSuperhighway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysforyou%2FSuperhighway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhysforyou","download_url":"https://codeload.github.com/rhysforyou/Superhighway/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysforyou%2FSuperhighway/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271252426,"owners_count":24726911,"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-08-19T02:00:09.176Z","response_time":63,"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":["combine","ios","macos","networking","spm","swift","swift-concurrency","swift-package-manager","tvos","watchos"],"created_at":"2024-12-19T05:18:04.740Z","updated_at":"2025-08-20T01:32:40.293Z","avatar_url":"https://github.com/rhysforyou.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Superhighway\n\n[![Build \u0026 Test Swift Package](https://github.com/rhysforyou/Superhighway/actions/workflows/swift-package.yml/badge.svg?branch=main)](https://github.com/rhysforyou/Superhighway/actions/workflows/swift-package.yml)\n![Swift Package Manager Recommended](https://img.shields.io/badge/SPM-recommended-blue?style=flat-square)\n![Supports macOS, iOS, tvOS, watchOS, and Linux](https://img.shields.io/badge/platform-macOS%20|%20iOS%20|%20tvOS%20|%20watchOS%20|%20Linux-blue?style=flat-square)\n[![Licensed under the Unlicense](https://img.shields.io/github/license/rhysforyou/Superhighway?color=blue\u0026style=flat-square)](LICENSE)\n\n[Swift Package Index listing](https://swiftpackageindex.com/rhysforyou/Superhighway) • [Documentation](https://swiftpackageindex.com/rhysforyou/Superhighway/main/documentation/superhighway) • [Compatibility](https://swiftpackageindex.com/rhysforyou/Superhighway/builds)\n\nSuperhighway is a networking library heavily inspired by [tiny-networking](https://github.com/objcio/tiny-networking). It defines an `Endpoint` type which encapsulates the relationship between a `URLRequest` and the `Decodable` entity it represents.\n\n## A Simple Example\n\n```swift\nstruct Repository: Decodable {\n    let id: Int64\n    let name: String\n}\n\nfunc getRepository(author: String, name: String) -\u003e Endpoint\u003cRepository\u003e {\n  return Endpoint(\n    decoding: Repository.self,\n    method: .get,\n    url: URL(string: \"https://api.github.com/repos/\\(author)/\\(name)\")!\n  )\n}\n\nlet endpoint = getRepository(author: \"rhysforyou\", name: \"Superhighway\")\n```\n\nThis simply gives us the description of an endpoint, to actually load it, we can pass it to a URLSession:\n\n```swift\ndo {\n    let (repository, _) = try await URLSession.default.response(for: endpoint)\n    print(\"Repository: \\(repository)\")\n} catch {\n    print(\"Error: \\(error)\")\n}\n```\n\nIf the task is cancelled before it finishes, any networking operations will be halted.\n\n## Installing\n\nThe recommended way to use Superhighway is through the Swift Package manager. For Xcode projects, simply add this repository to the project's Swift packages list. For projects using a `Package.swift` file, add the following:\n\n```swift\n// swift-tools-version:5.5\nimport PackageDescription\n\nlet package = Package(\n    // ...\n    dependencies: [\n        .package(url: \"https://github.com/rhysforyou/Superhighway.git\", \"0.5.0\"..\u003c\"0.6.0\")\n    ],\n    targets: [\n        .target(\n            name: \"MyTarget\",\n            dependencies: [\"Superhighway\"])\n    ]\n)\n```\n\nOther package managers such as CocoaPods and Carthage are officially unsupported, but this entire library is encapsulated in a single `Endpoint.swift` file which can be copied into an existing project and used as-is.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhysforyou%2Fsuperhighway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhysforyou%2Fsuperhighway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhysforyou%2Fsuperhighway/lists"}