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

fetch-ndjson

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

fetch-ndjson

fetch-ndjson turns new line delimited JSON streaming responses retrieved using Fetch API into Generators that yield JSON

  • 1.1.7
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
98
decreased by-77%
Maintainers
1
Weekly downloads
 
Created
Source

fetch-ndjson

fetch-ndjson turns new line delimited JSON streaming responses retrieved using Fetch API into Generators that yield JSON.

Install

npm i fetch-ndjson

Usage

import ndjson from 'fetch-ndjson';

let res = await fetch(pathname);
let reader = res.body.getReader();
let gen = ndjson(reader);
while (true) {
  let { done, value } = await gen.next();
  console.log(`done=${done}, value=${JSON.stringify(value)}`);
  if (done) {
    return;
  }
}

FAQs

Package last updated on 14 Apr 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