You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This package provides a json encoder and decoder in pure Swift (without the use of Foundation or any other dependency).
7
+
This package provides a json encoder and decoder in Swift (without the use of Foundation or any other dependency).
8
8
The implementation is [RFC8259](https://tools.ietf.org/html/rfc8259) compliant. It offers a significant performance improvement compared to the Foundation implementation on Linux.
9
9
10
-
If you like the idea of using pure Swift without any dependencies, you might also like my reimplementation of Base64 in pure Swift: [`swift-base64-kit`](https://github.com/fabianfett/swift-base64-kit)
10
+
If you like the idea of using Swift without any dependencies, you might also like our reimplementation of Base64 in Swift: [`swift-extras-base64`](https://github.com/swift-extras/swift-extras-base64)
11
11
12
12
## Goals
13
13
@@ -29,59 +29,59 @@ If you like the idea of using pure Swift without any dependencies, you might als
29
29
30
30
## Usage
31
31
32
-
Add `pure-swift-json` as dependency to your `Package.swift`:
32
+
Add `swift-extras-json` as dependency to your `Package.swift`:
var buffer = byteBufferAllocator.buffer(capacity: bytes.count)
72
72
buffer.writeBytes(bytes)
73
73
```
74
74
75
75
76
76
### Use with Vapor 4
77
77
78
-
Increase the performance of your Vapor 4 API by using `pure-swift-json` instead of the default Foundation implementation. First you'll need to implement the conformance to Vapor's `ContentEncoder` and `ContentDecoder` as described in the [Vapor docs](https://docs.vapor.codes/4.0/content/#custom-coders).
78
+
Increase the performance of your Vapor 4 API by using `swift-extras-json` instead of the default Foundation implementation. First you'll need to implement the conformance to Vapor's `ContentEncoder` and `ContentDecoder` as described in the [Vapor docs](https://docs.vapor.codes/4.0/content/#custom-coders).
|| macOS Swift 5.1 | macOS Swift 5.2 | Linux Swift 5.1 | Linux Swift 5.2 |
139
139
|:--|:--|:--|:--|:--|
140
140
| Foundation | 2.61s | 2.62s | 13.03s | 12.52s |
141
-
|PureSwiftJSON| 1.23s | 1.25s | 1.13s | 1.05s |
141
+
|ExtrasJSON| 1.23s | 1.25s | 1.13s | 1.05s |
142
142
| Speedup |~2x |~2x |**~10x**|**~10x**|
143
143
144
144
@@ -147,7 +147,7 @@ $ swift run -c release
147
147
|| macOS Swift 5.1 | macOS Swift 5.2 | Linux Swift 5.1 | Linux Swift 5.2 |
148
148
|:--|:--|:--|:--|:--|
149
149
| Foundation | 2.72s | 3.04s | 10.27s | 10.65s |
150
-
|PureSwiftJSON| 1.70s | 1.72s | 1.39s | 1.16s |
150
+
|ExtrasJSON| 1.70s | 1.72s | 1.39s | 1.16s |
151
151
| Speedup |~1.5x |~1.5x |**~7x**|**~8x**|
152
152
153
153
## Workarounds
@@ -242,7 +242,7 @@ struct MyEvent: Decodable {
242
242
}
243
243
```
244
244
245
-
Checkout a full example in the test file [DateCodingTests](https://github.com/fabianfett/pure-swift-json/blob/main/Tests/PureSwiftJSONTests/DateCodingTests.swift).
245
+
Checkout a full example in the test file [DateCodingTests](https://github.com/swift-extras/swift-extras-json/blob/main/Tests/ExtrasJSONTests/DateCodingTests.swift).
Please feel welcome and encouraged to contribute to `pure-swift-json`. This is a very young endeavour and help is always welcome.
263
+
Please feel welcome and encouraged to contribute to `swift-extras-json`. This is a very young endeavour and help is always welcome.
264
264
265
265
If you've found a bug, have a suggestion, or need help getting started, please open an Issue or a PR. If you use this package, I'd be grateful for sharing your experience.
0 commit comments