https://github.com/surfstudio/nodekit
https://github.com/surfstudio/nodekit
customizable ios network nodekit requests surf surfstudio
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/surfstudio/nodekit
- Owner: surfstudio
- License: mit
- Created: 2017-09-26T17:01:17.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2025-03-27T15:24:31.000Z (7 months ago)
- Last Synced: 2025-04-13T07:15:10.927Z (6 months ago)
- Topics: customizable, ios, network, nodekit, requests, surf, surfstudio
- Language: Swift
- Homepage: https://surfstudio.github.io/NodeKit/documentation/nodekit
- Size: 46.2 MB
- Stars: 34
- Watchers: 24
- Forks: 10
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Roadmap: ROADMAP.md
Awesome Lists containing this project
README
# NodeKit
[](https://github.com/surfstudio/NodeKit/actions)
[](https://codecov.io/gh/surfstudio/NodeKit)
[](https://github.com/apple/swift-package-manager)Flexible and customizable network library
---
![]()
## About
The NodeKit library enables rapid and easy creation of requests of varying complexity. The system operates on the principle of asynchronous data transformation, wherein nodes are interconnected to form a chain that transforms input data into a server response.

Such an approach allows us to flexibly adapt to a wide range of requirements.
## Build request using Swift Concurrency
```Swift
import NodeKit
// Define endpoints
enum Endpoint: URLRouteProvider {
case authfunc url() throws -> URL {
switch self {
case .auth:
return URL(string: "http://nodekit.com/auth")!
}
}
}// Build async request that takes AuthModel
func requestCredentials(authModel: AuthModel) async -> NodeResult {
return await URLChainBuilder()
.route(.post, .users)
.encode(as: .urlQuery)
.build()
.process(authModel)
}```
## Build request using Combine
```swift
func credentialsPublisher(for authModel: AuthModel) -> AnyPublisher, Never> {
return URLChainBuilder()
.route(.post, .users)
.encode(as: .urlQuery)
.build()
.nodeResultPublisher(for: authModel)
}```
## Installation
### Swift Package Manager
Using Xcode:
- Go to File > Swift Packages > Add Package Dependency
- Enter the URL of repository https://github.com/surfstudio/NodeKit.gitUsing Package.swift file:
Write dependency:
```swift
dependencies: [
.package(url: "https://github.com/surfstudio/NodeKit.git", .upToNextMajor(from: "5.0.0"))
]
```## Features
- Swift Concurrency
- Combine
- MultipartFormData
- URL QUERY / JSON / FORM URL Parameter Encoding
- Mapping JSON to Struct or Class Models
- Token refresher
- URLCach reader and writer
- Comprehensive Unit and Integration Test Coverage
- Mock target for Unit tests
- [Documentation](TechDocs/Documentation.md)
- [Code documentation](https://surfstudio.github.io/NodeKit/documentation/nodekit)## Contributing
If you want to contribute to NodeKit, please read the [guide](TechDocs/ContributionGuide.md) beforehand.
## Changelog
The list of changes you can found [here](CHANGELOG.md).
## License
NodeKit is released under the MIT license. See [LICENSE](LICENSE) for details.