1.2.9 • Published 7 years ago

superagent-debugger v1.2.9

Weekly downloads
333
License
MIT
Repository
github
Last release
7 years ago

Simple Log For Super Agent

Build Status Coverage Status

Introduction

An easy and fast way to identify and replicate rogue request on the fly

Dependencies

Logging and debugging for superagent


Install

npm install --save superagent-debugger

Usage

let superagent = require('superagent');
let superdebug = require('superagent-debugger');

superagent('GET', 'http://localhost:3000/debug')
    .set({Accept: 'application/json'})
    .query({superdebug: 'is-awesome'})
    .use(superdebug(console.info))
    .timeout(10000)
    .send()
    .end()

Output Log

super-curl curl -v -X GET -H 'User-Agent: node-superagent/3.3.2' -H 'Accept: application/json' http://localhost:3000/debug?superdebug=is-awesome +0ms
super-debug HTTP GET 200 http://localhost:3000/debug?superdebug=is-awesome (23ms) +25ms

Using Debug

DEBUG=super-debug,super-curl node sdk.js

screeshot1

options

const options = {logName: 'logDebug', curlName: 'curlDebug'}
    
 superagent('GET', 'http://localhost:3000/debug')
     .set({Accept: 'application/json'})
     .query({superdebug: 'is-awesome'})
     .use(superdebug(console.info, options))
DEBUG=logDebug,curlDebug node sdk.js

Help

Refer to the example provided

Improvement

  1. Test/Test coverage report
  2. CI/CD process
  3. Allow debug for client side request

Any feedbacks or contributions are welcome!

1.2.9

7 years ago

1.2.6

7 years ago

1.2.5

7 years ago

1.2.4

7 years ago

1.2.3

7 years ago

1.2.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago