json_stream 1.0.0 copy "json_stream: ^1.0.0" to clipboard
json_stream: ^1.0.0 copied to clipboard

A package for converting objects to JSON asynchronously to a byte stream.

json_stream #

A package for converting objects to JSON asynchronously to a byte stream.

This package is useful for encoding extremely large objects that would consume too much memory with a standard JsonEncoder.

Basic example:

import 'dart:async';
import 'dart:io';

import 'package:json_stream/writer.dart';

Future<void> main() async {
  await stdout.addStream(
    JsonStreamWriter.convert({
      'numbers': Stream.periodic(
        const Duration(milliseconds: 100),
            (i) => '$i',
      ).take(10),
      'letters': Stream.periodic(
        const Duration(milliseconds: 100),
            (i) => '${String.fromCharCode(i + 0x61)}',
      ).take(26),
    }),
  );
}
6
likes
150
pub points
66%
popularity

Publisher

verified publishertst.sh

A package for converting objects to JSON asynchronously to a byte stream.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

async, typed_data

More

Packages that depend on json_stream