Skip to content
This repository was archived by the owner on Dec 4, 2018. It is now read-only.
This repository was archived by the owner on Dec 4, 2018. It is now read-only.

JSONStream.stringify doesn't work on a huge JSON object #164

Description

@andy51002000

I was going to convert a huge JSON object to string by JSONStream.stringify but got error below
How can I fix this problem?

Unhandled rejection RangeError: Invalid string length
at Object.stringify (native)
at Stream. (/app/node_modules/JSONStream/index.js:194:23)
at Stream.stream.write (/app/node_modules/through/index.js:26:11)

  var transStream = JSONStream.stringify(false);
    transStream.pipe(
        req({
            url: `${process.env.ENDPOINT}`,
            method: 'POST',
            encoding: null
        }, (error, response, body) => {
            if (error) {
                console.log('Error sending message: ', error)
            } else {
                console.log('Response: ', response.body)
            }
        })
    );
    transStream.write(model);
    transStream.end();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions