New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jsoner

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsoner

Simple, fast, minimalist JSON library for node

  • 0.2.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

jsoner

Build Status Coverage Status

Simple, fast, minimalist JSON library for node

Installation

$ npm install jsoner

Features

  • stream parsing so you can read unlimited amounts of JSON data without ever having to hold the totality of the data in memory.
  • append to a JSON file on disk without having to ever read the whole object into memory.

Examples

Reading JSON objects from a large JSON file

var jsoner = require('jsoner');

var stream = fs.createReadStream('really_big.json');
jsoner.parse(stream)
.on('object', function(object) {
    console.log(JSON.stringify(object));
})
.on('error', function(err) {
    // do something with the error
}
.on('end', function() {

};

Appending multiple JSON objects to a JSON Array on disk

var jsoner = require('jsoner');

jsoner.appendFile('users.json', {
    firstName: "John",
    lastName:"Doe"
})
.then(function() {
    console.log('all done');
})
.catch(function(err) {
    console.error('there was an issue', err); 
});

jsoner.appendFileSync('users.json', {
    firstName: "Jane",
    lastName:"Doe"
})
.then(function() {
    console.log('all done');
})
.catch(function(err) {
    console.error('there was an issue', err); 
});

Development

To contribute feel free to open any issues or pull request. When developing locally make sure to run the built-in tests like so:

gulp test

In travis we run the following gulp tasks to make sure the current code is ready to be shipped:

gulp lint coverage

That runs the lint checks and then follows up with the same tests executed during gulp test but with the additional verification that 100% of the code is covered during testing and no untested code is introduced.

Keywords

FAQs

Package last updated on 28 Jan 2016

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