zipson-stream adds node stream support to zipson, a JSON.parse/stringify alternative with added compression.
Try zipson with the online demo
npm install --save zipson-stream
Stringify data to a zipson stream. Compression options can be provided according to zipson documentation
import { stringifyStream } from 'zipson-stream';
// const { stringifyStream } = require('zipson-stream');
const myData = [1, 2, 3, 4 ,5];
const stream = stringifyStream(myData, options);
stream.pipe(process.stdout);
Parse a zipson stream, resolves with the parsed data when the stream ends.
import { parseStream } from 'zipson-stream';
// const { parseStream } = require('zipson-stream');
parseStream(myStringifiedStream)
.then(parsedData => {
console.log(parsedData);
});
npm test
For running tests in watch mode while developing:
npm run testw
Pull requests are welcome. Please see the conventional commits guidelines for commit message formatting.
This project is versioned using SemVer See tags and CHANGELOG.md for version details.
This project is licensed under the MIT License - see LICENSE.md file for details