big-sync-json

1.1.13 • Public • Published

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

Package Sidebar

Install

npm i big-sync-json

Weekly Downloads

2

Version

1.1.13

License

MIT

Unpacked Size

19.1 kB

Total Files

6

Last publish

Collaborators

  • arfelious