Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

micro-visualize

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micro-visualize

Visualize requests in micro

  • 3.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

micro-visualize NPM travis-ci Greenkeeper

Visualizes requests and responses for services written with micro.

Screenshot


Installation

npm install --save micro-visualize

Or even better

yarn add micro-visualize

Import and Usage Example

const visualize = require('micro-visualize')

module.exports = visualize(async function (req, res) {
  return 'Hello, world!'
})

API

visualize

Visualize requests and responses for a given function. The function is a no-op if log is not dev.

Parameters

  • fn Function Async function, your normal micro logic.
  • log String An optional log level (default: dev)

Examples

const visualize = require('micro-visualize')

module.exports = visualize(async function (req, res) {
  return 'Hello, world!'
})
const visualize = require('micro-visualize')

// Will only visualize requests/responses if
// ``process.env.NODE_ENV`` is ``dev``
module.exports = visualize(async function (req, res) {
  return 'Hello, world!'
}, process.env.NODE_ENV)

Returns an async Function.

Credits

Thanks to @rickharrison for his excellent PR which this project was heavily based on.

Keywords

FAQs

Package last updated on 01 May 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc