How to use the stream-json/streamers/StreamObject.streamObject 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 ravendb / ravendb-nodejs-client / src / Mapping / Json / Streams / Pipelines.ts View on Github external
export function parseDocumentIncludes(
    bodyStream: stream.Stream,
    conventions: DocumentConventions) {
    return RavenCommandResponsePipeline.create<{ [key: string]: object }>()
        .parseJsonAsync([
            pick({ filter: "Includes" }),
            streamObject()
        ])
        .streamKeyCaseTransform(conventions.entityFieldNameConvention, "DOCUMENT_LOAD")
        .collectResult((result, next) => {
            result[next["key"]] = next["value"];
            return result;
        }, {})
        .process(bodyStream);
}

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