JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 24
  • Score
    100M100P100Q38075F
  • License MIT

Overcomes 512MB String limitation of regular JSON.parse() and JSON.stringify() by not stringifying the whole buffer.

Package Exports

  • big-sync-json
  • big-sync-json/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (big-sync-json) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Big Sync JSON

Overcomes 512MB String limitation of regular JSON.parse() and JSON.stringify() by not stringifying the whole buffer.

Usage Example

const fs = require('fs')
const BSJON = require('big-sync-json')

let jsonBuffer = fs.readFileSync('./big-json.json')

let jsonData = BSJON.parse(jsonBuffer)

let jsonBuffer2 = BSJSON.bufferize(jsonData)

fs.writeFileSync('./big-json.json', jsonBuffer2)

Features

  • It is a drop-in replacement for JSON.parse()

  • Does not require you to make any other changes in order to parse bigger JSON files on a project

Issues

Feel free to open issues on Github if you have any problems with the package. Although the package was tested with valid JSON files without any problems, for now, unexpected outputs may occur from non-valid JSON buffers.

License

MIT

Roadmap

  • Log the status if it is given as an option as it might take some time to parse or bufferize big files

  • Change errors to be compliant with JSON.parse() and JSON.stringify()

  • Support reviver argument from JSON.parse() on .parse() method

  • Support replacer and space arguments from JSON.stringify() on .bufferize() method

  • Support trailing commas as an option