Giter VIP home page Giter VIP logo

zipson-stream's Introduction

zipson-stream

Build Status npm version dependencies Status devDependencies Status

zipson-stream adds node stream support to zipson, a JSON.parse/stringify alternative with added compression.

Try zipson with the online demo


Installing

npm install --save zipson-stream

API

stringifyStream(data, options?)

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);
parseStream(stream)

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);
});

Running the tests

npm test

For running tests in watch mode while developing:

npm run testw

Contributing

Pull requests are welcome. Please see the conventional commits guidelines for commit message formatting.

Versioning

This project is versioned using SemVer See tags and CHANGELOG.md for version details.

License

This project is licensed under the MIT License - see LICENSE.md file for details

zipson-stream's People

Contributors

jgranstrom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

liufanghua2012

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.