Socket
Book a DemoInstallSign in
Socket

hapi-elapsed

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-elapsed

hapi-elapsed - Hapi plugin which logs elapsed time

latest
Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

hapi-elapsed: Hapi plugin which logs elapsed time

Build Status

Installation

Requires node.js >= 0.12

npm install ## install dependent node modules

Usage

// listen for our new elapsed log event
server.pack.events.on('log', function (event, tags) {
  if (tags.elapsed) {
    // do something with the elapsed event
    console.log('elapsed', event);
  }
});

var plugins = {
  'hapi-elapsed': {}
};
server.pack.require(plugins, function (err) {
  if (err) { throw err; }
  // plugin required, start server
});

Goals

  • compute elapsed time from the beginning of request to the end of the response
  • emit log event with elapsed time

Why

A simple functional Hapi plugin which calculates and logs elapsed time

Get involved

If you have input or ideas or would like to get involved, you may:

License

Keywords

hapi

FAQs

Package last updated on 25 Jun 2015

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