Skip to content
pubscout

rfc_6901

0.2.1, released a year ago by karapetov.com

Implements RFC 6901 JSON Pointer for reading, writing and removing values in JSON documents.

WASM-ready
$ flutter pub add rfc_6901
Source repository

What it does

Provides a Dart implementation of the JSON Pointer standard (RFC 6901). You can parse or build pointers, then read, write or remove the referenced value in a decoded JSON structure. All operations are pure and return new copies of the document.

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

Use it when

  • You need to navigate or modify JSON data by pointer paths without adding dependencies
  • You want a small, test‑covered library that follows the RFC exactly

Skip it when

  • You require full JSONPath or query capabilities
  • You need schema validation or complex transformation logic

Strengths

  • Zero external dependencies
  • Complete RFC 6901 support including the '-' token
  • 100 % test coverage and simple API

Weaknesses

  • Only handles pointer operations, no JSONPath or advanced querying
  • No code generation or async features

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0
import 'dart:convert';
import 'package:rfc_6901/rfc_6901.dart';

void main() {
  const json = '{"foo": [{"bar": 42}]}';
  final doc = jsonDecode(json);
  final pointer = JsonPointer('/foo/0/bar');
  print(pointer.read(doc)); // 42
  final updated = pointer.write(doc, 'banana');
  print(updated);
}

Alternatives

Packages that do the same job and could replace rfc_6901.

  • cv

    Helpers to convert Dart objects to/from Map and JSON without code generation.

  • ini

    Read and write INI configuration files in pure Dart

  • mutex

    Mutual exclusion locks and read-write locks for asynchronous Dart code

  • yaml_writer

    A library to write YAML documents supporting Object encoding and dart:convert Converter.

Works with

Packages commonly used together with rfc_6901: ones it builds on, ones built on it, and its own family.