JSPM

http-client-debug

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

debug utils for http-client

Package Exports

  • http-client-debug

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

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