Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including nodeify-fetch with all npm packages installed. Try it out:

var nodeifyFetch = require("nodeify-fetch")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

nodeify-fetch v2.0.0

Node streams for fetch

nodeify-fetch

The nodeify-fetch packages provides a node stream interface for fetch. It's based on isomorphic-fetch for node and browser support.

Usage

The only difference to the fetch standard is the .body property. nodeify-fetch patches the .body to a readable stream:

const fetch = require('nodeify-fetch')

fetch('url').then(res) => {
  res.body.on('data', (chunk) => {
    ...
  })

  res.body.on('end', () => {
    ...
  })
})
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free