Package Exports
- digest-fetch
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (digest-fetch) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
digest-fetch
digest auth request plugin for fetch/node-fetch.
Installation
// dependencies for node
npm install crypto-js node-fetch
// dependencies for browser
<script src='path-to-crypto-js.js'></script>
npm install digest-fetchGet Started
const DigestFetch = require('digest-fetch')
const client = DigestFetch('user', 'password', console) // console as logger, optional parameter
// do request same way as fetch or node-fetch
const url = ''
const options = {}
client.fetch(url, options)
.then(resp=>resp.json())
.then(data=>console.log(data))
.catch(e=>console.error(e))