Skip to content

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

License

Notifications You must be signed in to change notification settings

arfelious/big-sync-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published