JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 103370
  • Score
    100M100P100Q167488F
  • License MIT

Axios interceptor of logging requests & responses by debug.

Package Exports

  • axios-debug-log

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 (axios-debug-log) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

axios-debug-log

Build Status Coverage Status dependencies Status devDependencies Status JavaScript Style Guide

Axios interceptor of logging requests & responses by debug.

Screenshot

Install

$ npm install --save axios axios-debug-log

Node.js usage

  1. Install: add require('axios-debug-log') before any axios execution.
  2. Enable: set DEBUG=axios environment variables before start your fantastic Node.js application.

Browser usage

  1. Install: add require('axios-debug-log') before any axios execution.
  2. Enable: set localStorage.debug = "axios" before start your fantastic web application.

Please read README of debug for usage details.

Configuration

// Log content type
require('axios-debug-log')({
  request: function (debug, config) {
    debug('Request with ' + config.headers['content-type'])
  },
  response: function (debug, response) {
    debug(
      'Response with ' + response.headers['content-type'],
      'from ' + response.config.url
    )
  },
  error: function (debug, error) {
    // Read https://www.npmjs.com/package/axios#handling-errors for more info
    debug('Boom', error)
  }
})

License

MIT