mv

micro-visualize

Visualizes requests and responses for services written with micro

Showing:

Popularity

Downloads/wk

25

GitHub Stars

54

Maintenance

Last Commit

2yrs ago

Contributors

5

Package

Dependencies

2

Size (min+gzip)

10.1KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

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.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100