1.0.6 • Published 8 months ago

jsonsurge v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
8 months ago

StreamJSONParser

StreamJSONParser is a JavaScript module that provides a way to parse JSON data from a readable stream in an asynchronous and efficient manner. It is particularly useful when dealing with streaming JSON data, such as data received from server-sent events (SSE) or other real-time data sources.

Installation

You can install StreamJSONParser using npm or yarn:

npm install stream-json-parser

or

yarn add stream-json-parser

Usage

To use StreamJSONParser, you need to import it into your JavaScript or TypeScript code:

import streamJSONParser from 'stream-json-parser';

Example Usage

Here is an example of how to use StreamJSONParser to parse JSON data from a readable stream:

import streamJSONParser from 'stream-json-parser';

// Create a ReadableStream (e.g., from a fetch response)
const response = await fetch('https://example.com/streaming-data');
const stream = response.body;

for await (const chunk of streamjsonparser(response.body)) {
                console.log(chunk)
            }

How It Works

The streamJSONParser function accepts a readable stream as its input and returns an asynchronous generator that yields parsed JSON objects as they are received from the stream.

Contributing

If you'd like to contribute to StreamJSONParser, please open an issue or submit a pull request on GitHub.

License

StreamJSONParser is licensed under the MIT License.

Acknowledgments

StreamJSONParser is inspired by the need for efficient parsing of streaming JSON data in real-time applications.

About

StreamJSONParser is maintained by Gaurav mishra. You can contact me at garvmishra9@gmail.com.

For more information, visit the GitHub repository.

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago