Skip to content

Handling of large contract file with JSONStream #49

@akrysiak-equinix

Description

@akrysiak-equinix

Currently to read (and probably generate json) the tool uses: JSON.parse. For large contract files parsing ends up with exception:

SyntaxError: Expected ':' after property name in JSON at position 65536 (line 2154 column 19)
    at JSON.parse (<anonymous>)
    at generate (/usr/local/lib/node_modules/json-schema-faker-cli/node_modules/json-schema-faker/bin/gen.cjs:93:55)
    at Transform.transform [as _transform] (/usr/local/lib/node_modules/json-schema-faker-cli/node_modules/json-schema-faker/bin/gen.cjs:111:7)

The JSON parses stops after reaching max position: 65536

Would be feasible to use something like: https://www.npmjs.com/package/JSONStream?

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