Have ideas to improve npm?Join in the discussion! »

    parse-json-stream

    2.2.5 • Public • Published

    code style downloads license npm version

    parse-json-stream

    Stream-JSON parser.

    Parser for large streams of json data, allows processing objects asynchronously

    Usage

    const Parser = require("parse-json-stream");
    
    let parser = new Parser(function (error, object) {
    	if (error) {
    		console.log(error.message);
    	} else if (object) {
    		console.log(object);
    	} else {
    		console.log('done');
    	}
    });
    

    Then call it on every new chunk of data, i.e. the async request, e.g.

    const https = require("https");
    
    https.get(url, res => {
    	res.on("data", data => {
    		parser.parse(data);
    	});
    });
    

    Install

    npm i parse-json-stream

    DownloadsWeekly Downloads

    8

    Version

    2.2.5

    License

    MIT

    Unpacked Size

    4.05 kB

    Total Files

    4

    Last publish

    Collaborators

    • avatar