npm.io
1.0.3 • Published 8 years ago

jetch

Licence
ISC
Version
1.0.3
Deps
0
Size
1 kB
Vulns
0
Weekly
0
Stars
1

Jetch - fetch JSON


A slightly easier way to fetch json

Usage

import jetch from 'jetch';

try {
  var json = await jetch('http://mydomain.com/endpoint.json');
} catch(failedResponse) {
  //do something with failedResponse
}
//do something with `json`

a failed response is any response that is not HTTP status code 200