digest-fetch
Advanced tools
Comparing version 1.1.4 to 1.1.5
{ | ||
"name": "digest-fetch", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "digest auth request plugin for fetch/node-fetch also support http basic auth authentication", | ||
@@ -5,0 +5,0 @@ "main": "digest-fetch-src.js", |
@@ -22,10 +22,23 @@ # digest-fetch | ||
``` | ||
// Use require | ||
const DigestFetch = require('digest-fetch') | ||
// In browser: const DigestFetch = window.DigestFetch; | ||
// Use import | ||
import * as DigestFetch from "digest-fetch" | ||
// In browser | ||
const DigestFetch = window.DigestFetch; | ||
``` | ||
Initialize with option and credential | ||
#### Http Basic Authentication | ||
Create a client using basic authentication challenge | ||
``` | ||
const client = new DigestFetch('user', 'password', { basic: true }) | ||
client.fetch(url, options).then(res => res.json).then(console.dir) | ||
``` | ||
#### Digest Access Authentication | ||
Create a digest authentication request client with default options | ||
@@ -58,9 +71,2 @@ | ||
Create a client using basic authentication challenge | ||
``` | ||
const basic_auth_client = new DigestFetch('user', 'password', { basic: true }) | ||
``` | ||
Do request same way as fetch or node-fetch | ||
@@ -85,3 +91,2 @@ | ||
.catch(e=>console.error(e)) | ||
``` | ||
@@ -88,0 +93,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
254466
109
4