2.6.31 • Published 5 years ago

ziti-electron-fetch v2.6.31

Weekly downloads
9
License
Apache-2.0
Repository
github
Last release
5 years ago

ziti-electron-fetch

npm version build status install size

A module that intercepts all window.fetch calls in the web-app loaded within an Electron Renderer process, and routes those HTTP/REST calls over a Ziti network.

Motivation

Instead of implementing XMLHttpRequest in Node.js to run browser-specific Fetch polyfill, why not go from native http to fetch API directly? Hence, ziti-electron-fetch, minimal code for a window.fetch compatible API on Node.js runtime.

Features

  • Stay consistent with window.fetch API.
  • Make conscious trade-off when following WHATWG fetch spec and stream spec implementation details, document known differences.
  • Use native promise but allow substituting it with insert your favorite promise library.
  • Use native Node streams for body on both request and response.
  • Useful extensions such as timeout, redirect limit, response size limit, explicit errors for troubleshooting.

Difference from client-side fetch

  • See Known Differences for details.
  • If you happen to use a missing feature that window.fetch offers, feel free to open an issue.
  • Pull requests are welcomed too!

Installation

$ npm install ziti-electron-fetch

Loading and configuring the module

We suggest you load the module via require until the stabilization of ES modules in node:

const fetch = require('ziti-electron-fetch');

Acknowledgement

Thanks to node-fetch for providing a solid implementation reference.

License

Apache 2.0

2.6.31

5 years ago

2.6.30

5 years ago

2.6.29

5 years ago

2.6.28

5 years ago

2.6.27

5 years ago

2.6.26

5 years ago

2.6.25

5 years ago

2.6.24

5 years ago

2.6.23

5 years ago

2.6.22

5 years ago

2.6.21

5 years ago

2.6.20

5 years ago

2.6.19

5 years ago

2.6.18

5 years ago

2.6.17

5 years ago

2.6.16

5 years ago

2.6.15

5 years ago

2.6.14

5 years ago

2.6.13

5 years ago

2.6.12

5 years ago

2.6.11

5 years ago

2.6.10

5 years ago

2.6.9

5 years ago

2.6.7

5 years ago

2.6.8

5 years ago

2.6.6

5 years ago

2.6.5

5 years ago

2.6.4

5 years ago

2.6.3

5 years ago

2.6.2

5 years ago

2.6.0

5 years ago