1.1.0 • Published 7 years ago

fetch-json-and-header v1.1.0

Weekly downloads
1
License
X11
Repository
-
Last release
7 years ago

Fetch Json And Headers

Fetch's .json() that additionally grafts on a (non-enumerable) .headers.

Add a .jsonAndHeaders() method to Fetch's Response, which will attach a non-enumerable ._headers to the JSON-parse'd object.

Usage

import { install } from "fetch-json-and-headers
install()

var overthrusterRequest = await fetch({url: "http://yoyodyne.net/overthruster"}).
var overthruster = await overthrusterRequest.jsonAndHeaders()
overthruster._headers["X-Dimensions"] //=> 8
1.1.0

7 years ago

1.0.0

7 years ago