Socket
Socket
Sign inDemoInstall

big-json

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

big-json

A stream based implementation of JSON.parse and JSON.stringify for big POJOs


Version published
Weekly downloads
142K
increased by7.98%
Maintainers
1
Weekly downloads
 
Created

What is big-json?

The big-json npm package is designed to handle large JSON files efficiently. It provides functionality to parse and stringify large JSON objects without running into memory issues, making it suitable for applications that need to process big data in JSON format.

What are big-json's main functionalities?

Parse large JSON files

This feature allows you to parse large JSON files by streaming the data, which helps in avoiding memory overflow issues. The code sample demonstrates how to create a read stream from a large JSON file and pipe it into a parse stream provided by big-json.

const fs = require('fs');
const bigJson = require('big-json');

const readStream = fs.createReadStream('path/to/large-file.json');
const parseStream = bigJson.createParseStream();

parseStream.on('data', (data) => {
  console.log('Parsed data:', data);
});

readStream.pipe(parseStream);

Stringify large JSON objects

This feature allows you to stringify large JSON objects and write them to a file in a memory-efficient manner. The code sample shows how to create a stringify stream from a large JSON object and pipe it into a write stream to save it to a file.

const fs = require('fs');
const bigJson = require('big-json');

const writeStream = fs.createWriteStream('path/to/output-file.json');
const stringifyStream = bigJson.createStringifyStream({
  json: { large: 'object' }
});

stringifyStream.pipe(writeStream);

Other packages similar to big-json

Keywords

FAQs

Package last updated on 10 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc