Skip to content
pubscout

jsontool

2.1.0, released 3 years ago by infimum.dk

Low‑level tools for reading and writing JSON without creating intermediate Dart objects

WASM-ready
$ flutter pub add jsontool
Source repository

What it does

Provides JsonReader, JsonSink, JsonBuilder and JsonProcessor classes that operate directly on JSON strings, bytes or Dart structures. It allows pull‑based parsing, push‑based building and composable transformations.

AI-written summary of version 2.1.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need fast, memory‑efficient JSON processing in a performance‑critical part of your app
  • You want to avoid allocating intermediate List or Map objects when parsing large JSON payloads

Skip it when

  • You need code‑generation for JSON models
  • You prefer a higher‑level, auto‑generated API like json_serializable

Strengths

  • Zero intermediate allocations
  • Fine‑grained control over parsing
  • Supports both pull and push APIs
  • No external dependencies

Weaknesses

  • Experimental API
  • No code‑generation support
  • Requires manual handling of JSON structure
  • Limited documentation on advanced use cases

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:jsontool/jsontool.dart';
final reader = JsonReader.fromString('{"a":1}');
while (reader.hasNext) {
  final key = reader.expectString();
  final value = reader.expectInt();
  print('$key: $value');
}

Alternatives

Packages that do the same job and could replace jsontool.