docteurklein / Json Chunks
streamable json encoder
Stars: ✭ 17
Projects that are alternatives of or similar to Json Chunks
Rtmp Rtsp Stream Client Java
Library to stream in rtmp and rtsp for Android. All code in Java
Stars: ✭ 1,338 (+7770.59%)
Mutual labels: stream, encoder
Gojay
fastest JSON encoder/decoder with powerful stream API for Golang
Stars: ✭ 2,009 (+11717.65%)
Mutual labels: json, encoder
Streaming Json Encoder
PHP library for iteratively encoding large JSON documents piece by piece
Stars: ✭ 260 (+1429.41%)
Mutual labels: json, encoder
Zerocode
A community-developed, free, open source, microservices API automation and load testing framework built using JUnit core runners for Http REST, SOAP, Security, Database, Kafka and much more. Zerocode Open Source enables you to create, change, orchestrate and maintain your automated test cases declaratively with absolute ease.
Stars: ✭ 482 (+2735.29%)
Mutual labels: stream, json
Ultrajson
Ultra fast JSON decoder and encoder written in C with Python bindings
Stars: ✭ 3,504 (+20511.76%)
Mutual labels: json, encoder
Ikigajson
A high performance JSON library in Swift
Stars: ✭ 302 (+1676.47%)
Mutual labels: json, encoder
Jingo
This package provides the ability to encode golang structs to a buffer as JSON very quickly.
Stars: ✭ 715 (+4105.88%)
Mutual labels: json, encoder
Himotoki
A type-safe JSON decoding library purely written in Swift
Stars: ✭ 786 (+4523.53%)
Mutual labels: json
Smux
A Stream Multiplexing Library for golang with least memory usage
Stars: ✭ 818 (+4711.76%)
Mutual labels: stream
Jackson Module Kotlin
Module that adds support for serialization/deserialization of Kotlin (http://kotlinlang.org) classes and data classes.
Stars: ✭ 830 (+4782.35%)
Mutual labels: json
Ky
🌳 Tiny & elegant JavaScript HTTP client based on the browser Fetch API
Stars: ✭ 7,047 (+41352.94%)
Mutual labels: json
json-chunks
What ?
A php library that allows to stream chunks of json documents.
How ?
It takes advantage of php generators and the native json_encode
function.
To start streaming parts of a document, pass a function that yield
serializable values.
Note: You can nest multiple generators together.
Example
$chunks = DocteurKlein\JsonChunks\Encode::from([
'_links' => [
'product' => function() {
yield from [1, 2, 3];
},
],
'_embedded' => [
'product' => function() {
yield from [
1,
2,
function() {
yield from [3];
}
];
},
],
]);
foreach ($chunks as $chunk) {
echo $chunk;
}
Tradeoffs
- This library won't try to pretty print the streamed content. It provides a
pretty
option for debug purposes, but that will buffer the whole output and thus won't stream anymore. - Arrays containing both numeric and string indexes will be encoded to a json object or array depending on the type of the first key.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].