hapi-elapsed

0.0.2 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i hapi-elapsed

Weekly Downloads

1

Version

0.0.2

License

none

Last publish

Collaborators

  • jeffbski