JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 26276
  • Score
    100M100P100Q144893F
  • License MIT

Node streams for fetch

Package Exports

  • nodeify-fetch

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (nodeify-fetch) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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', () => {
    ...
  })
})