digest-fetch
Advanced tools
Comparing version 3.0.4 to 3.1.0
{ | ||
"name": "digest-fetch", | ||
"version": "3.0.4", | ||
"version": "3.1.0", | ||
"description": "digest auth request plugin for fetch/node-fetch also support http basic auth authentication", | ||
@@ -29,4 +29,4 @@ "main": "digest-fetch-src.js", | ||
"exports": { | ||
"default": "./digest-fetch-src.js", | ||
"types": "./digest-fetch-src.d.ts" | ||
"types": "./digest-fetch-src.d.ts", | ||
"default": "./digest-fetch-src.js" | ||
}, | ||
@@ -33,0 +33,0 @@ "devDependencies": { |
@@ -14,3 +14,3 @@ # digest-fetch | ||
For digest-fetch 3.0.0 or above | ||
``` | ||
```sh | ||
npm install digest-fetch@latest node-fetch@latest | ||
@@ -21,3 +21,3 @@ | ||
For digest-fetch 2.0.3 or below | ||
``` | ||
```sh | ||
npm install digest-fetch@v2 node-fetch@v2 | ||
@@ -29,3 +29,3 @@ | ||
``` | ||
```js | ||
// Use require for digest-fetch 2.0.3 or below | ||
@@ -49,3 +49,3 @@ const DigestClient = require('digest-fetch') | ||
``` | ||
```sh | ||
// Install dependencies | ||
@@ -61,3 +61,3 @@ npm install digest-fetch@latest node-fetch@latest | ||
``` | ||
```sh | ||
// Install dependencies | ||
@@ -74,3 +74,3 @@ npm install digest-fetch@v2 node-fetch@v2 | ||
``` | ||
```js | ||
const client = new DigestClient('user', 'password', { basic: true }) | ||
@@ -84,3 +84,3 @@ client.fetch(url, options).then(res => res.json).then(console.dir) | ||
``` | ||
```js | ||
const client = new DigestClient('user', 'password') | ||
@@ -91,3 +91,3 @@ ``` | ||
``` | ||
``` js | ||
const client = new DigestClient('user', 'password', { algorithm: 'MD5' }) | ||
@@ -97,3 +97,3 @@ ``` | ||
Supported Algorithm | ||
``` | ||
```js | ||
['MD5', 'MD5-sess', 'SHA-256', 'SHA-256-sess', 'SHA-512-256', 'SHA-512-256-sess'] | ||
@@ -119,3 +119,3 @@ ``` | ||
``` | ||
```js | ||
const url = '' | ||
@@ -131,3 +131,3 @@ const options = {} | ||
For example when posting with file stream: | ||
``` | ||
```js | ||
const factory = () => ({ method: 'post', body: fs.createReadStream('path-to-file') }) | ||
@@ -134,0 +134,0 @@ client.fetch(url, {factory}) |
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
29504