fetch json-enhanced api (ES6) - using isomorphic-fetch lib

Usage no npm install needed!

<script type="module">
  import slimFetchy from '';


slim-fetchy 🚀

Enhanced fetch API.

  • ✔ Simple HTTP request
  • ✔ Small
  • ✔ Encode POST Body
  • ✔ Response parser
  • ✔ Smarter error handling


I was listening to Slim Shady EP. And all the other names were taken.


# Add to your project:
npm install slim-fetchy --save

# Optionally, clone Code:
git clone
cd slim-fetchy
npm install
npm test

Seriously, Why?

The current fetch API spec and the implementation from Github are ill-suited for the majority of use-cases.

Specifically, JSON-backed services require repetitive encoding and response parsing. Additionally, acquiring HTTP response body content requires 2 promise .then() calls. (Some Promise libraries, like bluebird will automatically handle this for you.)

I decided to create a wrapper to eliminate frequent hurdles & repetitive code.

slim-fetchy JSON optimized usage:

// Using slim-fetchy (optional: es6 destructuring)
  .then(({body}) => {
    document.body.innerHTML = body; // SINGLE `.then` - has access to headers, status & statusText

Compared to current fetch API/spec:

// Using github's implementation
  .then(function(response) {
    return response.text()
  }).then(function(body) {
    document.body.innerHTML = body

Stats & Support Info

  • Requires Promise support - native or polyfilled. Tested with Bluebird and es6-promise
  • Runs on: Browser & NodeJS
  • Gzipped: 2.8K