Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

oboe

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oboe

Oboe.js reads json, giving you the objects as they are found without waiting for the stream to finish

  • 2.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
346K
increased by8.95%
Maintainers
1
Weekly downloads
 
Created

What is oboe?

The oboe npm package is a library for streaming JSON over HTTP. It allows you to parse JSON as it is being received, which can be useful for handling large JSON responses or for real-time data processing.

What are oboe's main functionalities?

Streaming JSON Parsing

This feature allows you to parse JSON data as it is being streamed from an HTTP source. The `node` method is used to handle individual nodes as they are parsed, and the `done` method is called when the entire JSON has been parsed.

const oboe = require('oboe');

oboe('http://example.com/big.json')
  .node('!.*', function(node) {
    console.log('Parsed node:', node);
  })
  .done(function(parsedJson) {
    console.log('Finished parsing:', parsedJson);
  });

Pattern Matching

Oboe allows you to use pattern matching to extract specific parts of the JSON data as it is being parsed. In this example, the `node` method is used to match the `author.name` pattern and log the author's name.

const oboe = require('oboe');

oboe('http://example.com/big.json')
  .node('!author.name', function(name) {
    console.log('Author name:', name);
  });

Error Handling

Oboe provides error handling capabilities to manage issues that may arise during the JSON parsing process. The `fail` method is used to handle any errors that occur.

const oboe = require('oboe');

oboe('http://example.com/big.json')
  .fail(function(error) {
    console.error('Failed to parse JSON:', error);
  });

Other packages similar to oboe

Keywords

FAQs

Package last updated on 05 Jan 2015

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