Wretch

Immutable
Intuitive
Chainable
Isomorphic
Standard

Wretch does not mutate its internal state.
Each function returns a copy of the original object.

Wretch's syntax is readable and concise.
And it contains typescript definition files for autocompletion.

All methods are 100% chainable.
Because a.b().c() is prettier than var z = a; z.b(); z.c().

Wretch is compatible with browsers and node.js.
And you can use any polyfill you like !

Wretch relies on the latest web standards like Promises, Fetch or the Performance API.

A tiny (< 2.4Kb g-zipped) wrapper built around fetch with an intuitive syntax.

npm i wretch
<script src="https://unpkg.com/wretch"></script>

Usage

import wretch from "wretch"
wretch()
  .helperMethods() //.url, .options, .headers ...
  .bodyType()      // .json, .formData, .formUrl ...
  .httpMethod()    // .get, .post, .put ...
  .errorCatchers() // .notFound, .unauthorized ...
  .responseType()  // .json, .blob ...
  .then/catch()
// Like aborting a request