Swiftpack.co - Package - Ikiga/IkigaJSON


IkigaJSON is a really fast JSON parser. It performed ~4x faster in our tests when decoding a type from JSON.

Adding the dependency


.package(url: "https://github.com/Ikiga/IkigaJSON.git", from: "1.1.0"),


pod 'IkigaJSON', '~> 1.1'


import IkigaJSON

struct User: Codable {
    let id: Int
    let name: String

let data = Data()
var decoder = IkigaJSONDecoder()
let user = try decoder.decode(User.self, from: data)


IkigaJSON supports raw JSON types (JSONObject and JSONArray) like many other libraries do, alongside the codable API described above. The critical difference is that IkigaJSON edits the JSON inline, so there's no additional conversion overhead from Swift type to JSON.

var user = JSONObject()
user["username"] = "Joannis"
user["roles"] = ["admin", "moderator", "user"] as JSONArray
user["programmer"] = true


SwiftNIO support

The encoders and decoders support SwiftNIO.

var user = try JSONObject(buffer: byteBuffer)

We also have added the ability to use the IkigaJSONEncoder and IkigaJSONDecoder with JSON.

let user = try decoder.decode([User].self, from: byteBuffer)
var buffer: ByteBuffer = ...

try encoder.encodeAndWrite(user, into: &buffer)

The above method can be used to stream multiple entities from a source like a database over the socket asynchronously. This can greatly reduce memory usage.


By design you can build on top of any data storage as long as it exposes a pointer API. This way, IkigaJSON doesn't (need to) copy any data from your buffer keeping it lightweight. The entire parser can function with only 1 memory allocation and allows for reusing the Decoder to reuse the memory allocation.


  • All decoding strategies that Foundation supports
  • Unicode
  • Codable
  • Escaping
  • Performance 🚀
  • Date/Data encoding strategies
  • Raw JSON APIs (non-codable)


  • \u escaped unicode characters
  • Codable decoding from JSONObject and JSONArray
  • Lightweight JSON inline comparison helpers




Stars: 19
Help us keep the lights on


Used By

Total: 1


1.1.1 - Feb 14, 2019

  • Remove submodule

1.1.0 - Jan 27, 2019

IkigaJSON now supports SwiftNIO out of the box. It also comes with a two new types (JSONArray and JSONObject) that can mutate JSON inline, very efficiently! The two types intentionally miss features/API, so if you're missing API be sure to open an issue!

1.0.3 - Nov 23, 2018

  • More performant JSON encoding

1.0.2 - Nov 20, 2018

Remove accidental submodule

1.0.1 - Nov 19, 2018

  • Reimplemented date decoding strategies and implemented some tests