Search the license for a given GitHub repository.
let repos = try await LicenseSearcher().search(repoName: "GitHubLicenseSearchKit")
print(repos.items.map { $0.license!.name }.first!) // MIT License
Xcode 13.3+
// swift-tools-version:5.5
import PackageDescription
let package = Package(
name: "YourProject",
dependencies: [
.package(url: "https://github.com/elmetal/GitHubLicenseSearchKit.git", .from: "0.0.1")
],
targets: [
.target(name: "YourProject", dependencies: ["GitHubLicenseSearchKit"])
]
)
GitHubLicenseSearchKit uses the API in this document.