# axios-digest

> [![Build Status](https://travis-ci.com/rearn/axios-digest.svg?branch=master)](https://travis-ci.com/rearn/axios-digest)

Latest version **0.3.0** (published 2021-12-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install axios-digest
pnpm add axios-digest
yarn add axios-digest
bun add axios-digest
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2021-12-08 |
| First published | 2019-04-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 24.8 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 7 |
| Author | minamibashi rearn |
| Maintainers | rearn |
| Keywords | axios, digest |

## Links

- npm: https://www.npmjs.com/package/axios-digest
- Repository: https://github.com/rearn/axios-digest
- Homepage: https://github.com/rearn/axios-digest#readme
- Issues: https://github.com/rearn/axios-digest/issues
- npm.io page: https://npm.io/package/axios-digest

## Dependencies (4)

- [axios](https://npm.io/package/axios.md) ^0.24.0
- [js-md5](https://npm.io/package/js-md5.md) ^0.7.3
- [js-sha256](https://npm.io/package/js-sha256.md) ^0.9.0
- [js-sha512](https://npm.io/package/js-sha512.md) ^0.8.0

## Recent versions

- 0.3.0 (latest) — 2021-12-08
- 0.2.0 — 2020-08-20
- 0.1.1 — 2019-04-16
- 0.1.0 — 2019-04-16

## README

# axios-digest
[![Build Status](https://travis-ci.com/rearn/axios-digest.svg?branch=master)](https://travis-ci.com/rearn/axios-digest)

`axios-digest` is axios add digest auth.

## Installation

``` sh
npm install --save axios-digest
```

## Usage
See test code. (`index.test.ts`)
It pretty much is a wrapper around Axios. the primary or most commonly-used HTTP methods only are available -> `POST, PUT, PATCH, GET, DELETE, HEAD`. See below for usage upfront (It was inspired from the test file).

### AxiosDigest Constructor AxiosDigest(username: string, passwd: string, customAxios: AxiosInstance|AxiosStatic)

### Parameters

- `username`: Not optional | `string`.
- `password`: Not optional | `string`.
- `customAxios`: Optional. An existing axios instance | `AxiosInstance|AxiosStatic`.

```js
import AxiosDigest from '.';

const username = '[username]';
const passwd = '[pass]';

const base = 'http://localhost';

const axiosDigest = new AxiosDigest(username, passwd);
// Go ahead and make them request!

```

### Fields && Methods

#### axiosDigest.info

Interface for setting the username && password beyond the `constructor`. It does not include a custom Axios instance as in the constructor.
It receives an object and the fields `username` && `passwd` are not Optional, and returns the same, only that the value for field `passwd` is masked.  

```js
axiosDigest.info = {username, passwd};
const info = axiosDigest.info; // { username: '[username]', passwd: '***' }
```

### axiosDigest[HTTP_METHODS]

The HTTP Methods available have been previously highlighted and returns a Promise<any>.

### Similar Parameters

- `path`: Not optional | `string`.
-  `data`: Optional | `any`.
- `config`: Optional | `AxiosRequestConfig`.


#### axiosDigest.head

Makes a `HEAD` request.

```js
axiosDigest.head(path: string, config?: AxiosRequestConfig): Promise<any>;
```
  
#### axiosDigest.delete

Makes a `DELETE` request.

```js
axiosDigest.delete(path: string, config?: AxiosRequestConfig): Promise<any>;
```
  
#### axiosDigest.get

Makes a `GET` request.

```js
axiosDigest.get(path: string, config?: AxiosRequestConfig): Promise<any>;
```
  
#### axiosDigest.patch

Makes a `PATCH` request.

```js
axiosDigest.get(path: string, data: any, config?: AxiosRequestConfig): Promise<any>;
```

#### axiosDigest.put

Makes a `PUT` request.

```js
axiosDigest.put(path: string, data: any, config?: AxiosRequestConfig): Promise<any>;
```
  
#### axiosDigest.post

Makes a `POST` request.

```js
axiosDigest.post(path: string, data: any, config?: AxiosRequestConfig): Promise<any>;
```

## License

MIT

---
_Source: https://npm.io/package/axios-digest · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
