Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

http-client-debug

chentsulin3MIT0.1.2

debug utils for http-client

http, http-client, fetch, isomorphic-fetch, debug

readme

http-client-debug

NPM version Build Status Test coverage Dependency Status

debug utils for http-client

Install

$ npm install http-client-debug

Usage

import { createStack } from 'http-client';

const middlewares = [
  header('X-Auth-Key', key),
  header('X-Auth-Email', email),
  base('https://api.cloudflare.com/client/v4'),
  parseJSON(),
];

if (process.env.NODE_ENV === 'development') {
  const { log } = require('http-client-debug');
  middlewares.push(log());
}

const stack = createStack(...middlewares);

// Get "response": ....

or use a path to log property from response:

import { createStack } from 'http-client';

const middlewares = [
  header('X-Auth-Key', key),
  header('X-Auth-Email', email),
  base('https://api.cloudflare.com/client/v4'),
  parseJSON(),
];

if (process.env.NODE_ENV === 'development') {
  const { log } = require('http-client-debug');
  middlewares.push(log('jsonData.user.name'));
}

const stack = createStack(...middlewares);

// Get "response.jsonData.user.name": Peter

API

log(path)

path

Optional Type: string

info(path)

path

Optional Type: string

warn(path)

path

Optional Type: string

error(path)

path

Optional Type: string

License

MIT © C.T. Lin

changelog

0.1.0 (2016/x/x)

Features

  • A:
  • B:

Bugs Fixed

  • C: