https://github.com/sebastianlzy/superagent-debugger
A simple debugging log for superagent
https://github.com/sebastianlzy/superagent-debugger
debug superagent
Last synced: 6 months ago
JSON representation
A simple debugging log for superagent
- Host: GitHub
- URL: https://github.com/sebastianlzy/superagent-debugger
- Owner: sebastianlzy
- Created: 2017-01-22T13:46:34.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-21T17:20:58.000Z (over 8 years ago)
- Last Synced: 2025-04-12T02:03:52.207Z (6 months ago)
- Topics: debug, superagent
- Language: JavaScript
- Size: 482 KB
- Stars: 14
- Watchers: 0
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple Log For Super Agent
[](https://travis-ci.org/sebastianlzy/superagent-debugger)
[](https://coveralls.io/github/sebastianlzy/superagent-debugger)### Introduction
An easy and fast way to identify and replicate rogue request on the fly### Dependencies
Logging and debugging for [superagent](https://github.com/visionmedia/superagent)-----------
### Install```cli
npm install --save superagent-debugger
```### Usage
```js
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
```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
```
### options
```js
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. [x] Test/Test coverage report
2. [ ] CI/CD process
3. [ ] Allow debug for client side requestAny feedbacks or contributions are welcome!