jsmn

Jsmn - a world fastest JSON parser - in pure Nim

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:24

Installation

nimble install jsmn
choosenim install jsmn
git clone https://github.com/OpenSystemsLab/jsmn.nim

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
jsmn - - - - - - -

Source

Repository https://github.com/OpenSystemsLab/jsmn.nim
Homepage https://github.com/OpenSystemsLab/jsmn.nim
Registry Source nimble_official

README

jsmn.nim

Jsmn - a world fastest JSON parser - in pure Nim

According to this benchmark script with about 3MB JSON of World Bank dataset, JSMN is 2-2.5 times faster than marshal Benchmark result

Benchmark result

Usage

import jsmn
const
  json = """{
    "user": "johndoe",
    "admin": false,
    "uid": 1000,
    "groups": ["users", "wheel", "audio", "video"]}"""

var tokens = newSeq[JsmnToken](32) # expect not more than 32 tokens
let r = parseJson(json, tokens)

for i in 1..r:
  var token = addr tokens[i]
  echo "Kind: ", token.kind
  echo "Value: ", json[token.start..<token.stop]