New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

superagent-logger

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

superagent-logger

superagent middleware for adding NPM-style logging. Useful for debugging HTTP clients.

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

superagent-logger

npm downloads npm version

superagent middleware for adding NPM-style logging. Useful for debugging HTTP clients.

Installing

This package is published to NPM as superagent-logger.

npm install superagent-logger

Usage

var request = require('superagent');
var logger = require('superagent-logger');

request.get('https://github.com/').use(logger).query({ q: 'search' }).end();
request.post('https://github.com/').use(logger).end();

This will produce the following output:

screeshot1

Options

Outgoing

If you want to log requests when they're fired, use the outgoing option:

// Will log when the request is triggered:
request.get('https://github.com/').use(logger({ outgoing: true })).end();

screeshot2

Timestamp

To log a request timestamp with each log entry, use the timestamp option:

// Will log when the request is triggered:
request.get('https://github.com/').use(logger({ timestamp: true })).end();
HTTPS GET   [2015-12-03T18:09:19.476Z] 200 https://github.com/ (9219ms)

License

This code is licensed under the MIT license for Pedro Tacla Yamada.

Keywords

superagent

FAQs

Package last updated on 22 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts