npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

axios-digest

v0.3.0

Published

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

Downloads

5,856

Readme

axios-digest

Build Status

axios-digest is axios add digest auth.

Installation

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.
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.

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.

Similar Parameters

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

axiosDigest.head

Makes a HEAD request.

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

axiosDigest.delete

Makes a DELETE request.

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

axiosDigest.get

Makes a GET request.

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

axiosDigest.patch

Makes a PATCH request.

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

axiosDigest.put

Makes a PUT request.

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

axiosDigest.post

Makes a POST request.

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

License

MIT