Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Rootencoder | 2,211 | a day ago | 235 | apache-2.0 | Java | |||||
RootEncoder for Android (rtmp-rtsp-stream-client-java) is a stream encoder to push video/audio to media servers using protocols RTMP, RTSP and SRT with all code written in Java/Kotlin | ||||||||||
Csv | 472 | 200 | 54 | 5 days ago | 46 | November 26, 2023 | 2 | mit | Elixir | |
CSV Decoding and Encoding for Elixir | ||||||||||
Cocoasplit | 338 | 4 years ago | 30 | Objective-C | ||||||
Stream/record your desktop/webcam to twitch/owned etc. | ||||||||||
Streaming Json Encoder | 294 | 6 | 5 | a year ago | 7 | December 09, 2022 | mit | PHP | ||
PHP library for iteratively encoding large JSON documents piece by piece | ||||||||||
Switch Remote Play | 220 | a year ago | 16 | gpl-3.0 | C++ | |||||
Let the switch remotely play PC games (similar to steam link or remote play) | ||||||||||
Mp4 Stream | 197 | 144 | 9 | 3 years ago | 13 | February 24, 2021 | 13 | mit | JavaScript | |
Streaming mp4 encoder and decoder | ||||||||||
Csv Write Stream | 188 | 442 | 158 | 3 years ago | 12 | April 28, 2016 | 12 | bsd-2-clause | JavaScript | |
A CSV encoder stream that produces properly escaped CSVs | ||||||||||
Decompress | 111 | 2 months ago | 7 | mit | OCaml | |||||
Pure OCaml implementation of Zlib. | ||||||||||
Audify | 96 | 1 | 2 | 8 months ago | 38 | April 11, 2023 | 11 | mit | C++ | |
Play/Stream/Record PCM audio data & Encode/Decode Opus to PCM audio data | ||||||||||
Jpg Stream | 75 | 25 | 10 | 6 years ago | 7 | August 23, 2017 | 3 | C++ | ||
A streaming JPEG encoder and decoder |
JSON encoding for Highland.js stream.
This JSON encoder not only encoding stream of objects, but also encode streams recursively. You can pass a stream of stream of number, and it will return an array of array of number.
npm install highland-json
import _ from 'highland';
import {stringify} from 'highland-json';
const input = [
{ a : "b", b : "c" },
{ a : [1, 2, 3] },
[ 1, 2, 3 ],
[ { a : "b", b : "c" } ]
];
_(input)
.through(stringify)
.toArray(results => {
let result = results.join('');
// result === input
});
import _ from 'highland';
import {stringify} from 'highland-json';
const input = [
{ a : "b", b : "c" },
_([ 1, 2, 3 ]),
_([ {
a : "b",
b : _([4, 5, 6])
}
])
];
_(input)
.through(stringify)
.toArray(results => {
let result = results.join('');
/*
result === [
{ "a" : "b", "b" : "c" },
[ 1, 2, 3 ],
[ {
"a" : "b",
"b" : [4, 5, 6]
} ]
];*/
});
stringifyObj
accepts a stream of [key, value]
array.
import _ from 'highland';
import {stringifyObj} from 'highland-json';
/* Key value pair */
const input = [
['a', 'b'],
['c', 'd'],
['e', ['f', 'g', 'h']]
]
_(input)
.through(stringifyObj)
.toArray(results => {
let result = results.join('');
/*
result === {
"a": "b",
"c": "d",
"e": ["f", "g", "h"]
} */
};
stringifyObj
also accepts stream of single object, the object will be encoded as an object ({}
), please only pass one object to the stream. If the stream is given more than one object, it will output something like {"a":1}{"a":2}
, which is not a valid JSON. Use stringify
for that case.
import _ from 'highland';
import {stringifyObj} from 'highland-json';
/* Key value pair */
const input = {
a: "b",
c: "d",
e: ["f", "g", "h"]
}
_(input)
.through(stringifyObj)
.toArray(results => {
let result = results.join('');
/*
result === {
"a": "b",
"c": "d",
"e": ["f", "g", "h"]
} */
};
Remember to pass through stringifyObj
when you are encoding objects.
const input = {
a : _([
_([1, 2, 3]),
_([4, 5, 6])
]),
b : _([{
c: _([{
d: 'e',
f: 'g'
}]).through(stringifyObj),
h: _([{
i: 'j',
k: 'l'
}]).through(stringifyObj)
}
]).through(stringifyObj)
};
_([input])
.through(stringifyObj)
.toArray(results => {
let result = JSON.parse(results.join(''));
/*
result === {
a : [[1,2,3], [4,5,6]],
b : {
c : {d:'e', f:'g'},
h : {i:'j', k:'l'}
}
} */
});
In case if you want to use a custom stringify function.
import _ from 'highland';
import {stringify} from 'highland-json';
const input = ['a', 'b', 'c'];
const customStringify = (val, stream)=> JSON.stringify(val + '1');
_(input)
.through(stringify({stringify: customStringify}))
.toArray(results => {
let result = results.join('');
// result === ['a1', 'b1', 'c1']
});
const input = {
nums: _([1, 2, 3]),
strings: _(['a', 'b', 'c']),
};
const customStringify = (val, stream)=> {
if (stream === input.nums) {
return JSON.stringify(val * 10);
}
if (stream === input.strings) {
return JSON.stringify(val + '1');
}
throw new Error("Unreachable");
};
_([input])
.through(stringifyObj({stringify: customStringify}))
.toArray(results => {
const result = JSON.parse(results.join(''));
/*
result === {
nums: [10, 20, 30],
strings: ['a1', 'b1', 'c1'],
};
*/
});