2.6.31 • Published 4 years ago

ziti-electron-fetch v2.6.31

Weekly downloads
9
License
Apache-2.0
Repository
github
Last release
4 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

4 years ago

2.6.30

4 years ago

2.6.29

4 years ago

2.6.28

4 years ago

2.6.27

4 years ago

2.6.26

4 years ago

2.6.25

4 years ago

2.6.24

4 years ago

2.6.23

4 years ago

2.6.22

4 years ago

2.6.21

4 years ago

2.6.20

4 years ago

2.6.19

4 years ago

2.6.18

4 years ago

2.6.17

4 years ago

2.6.16

4 years ago

2.6.15

4 years ago

2.6.14

4 years ago

2.6.13

4 years ago

2.6.12

4 years ago

2.6.11

4 years ago

2.6.10

4 years ago

2.6.9

4 years ago

2.6.7

4 years ago

2.6.8

4 years ago

2.6.6

4 years ago

2.6.5

4 years ago

2.6.4

4 years ago

2.6.3

4 years ago

2.6.2

4 years ago

2.6.0

4 years ago