How to use the stream-json/streamers/StreamArray.withParser function in stream-json

To help you get started, we’ve selected a few stream-json examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github magda-io / magda / scripts / create-region-synonym-file.js View on Github external
.on("response", response => {
                try {
                    if (
                        response.statusCode >= 200 &&
                        response.statusCode <= 299
                    ) {
                        resolve(response.pipe(StreamArray.withParser()));
                    } else {
                        throw new Error(
                            `Request failed ${url}, statusCode: ${response.statusCode}`
                        );
                    }
                } catch (e) {
                    console.error(e);
                    reject(e);
                }
            });
    });

stream-json

stream-json is the micro-library of Node.js stream components for creating custom JSON processing pipelines with a minimal memory footprint. It can parse JSON files far exceeding available memory streaming individual primitives using a SAX-inspired API. I

BSD-3-Clause
Latest version published 1 month ago

Package Health Score

77 / 100
Full package analysis