Skip to content

Mkohm/streaming_json_parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This dart package parses incomplete or "streaming" JSON which is useful for parsing JSON from a stream. For example when you want intermediate parsing results while waiting for the complete JSON to arrive.

It is not suitable for parsing large JSON documents as a stream since the parser starts from scratch whenever you call the parse method.

It is based on the code provided by https://github.com/eatonphil/pj and modified slightly to support parsing incomplete JSON.

Features

  • Parses incomplete JSON

Getting started

In the pubspec.yaml, add the following dependency:

dependencies:
  streaming_json_parser: ^0.0.3

In your library file add the following import:

import 'package:streaming_json_parser/streaming_json_parser.dart';

Usage

import 'package:streaming_json_parser/streaming_json_parser.dart';

parse('{'); // returns {}
parse('{"key": "value", "someOtherIncomplet'); // returns {"key": "value"}
parse('{"key": ["value", "value2'); // returns {"key": ["value", "value2"]}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy