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

Description
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();