New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hapi-pino

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-pino

Hapi plugin for the Pino logger

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
35K
decreased by-22.8%
Maintainers
1
Weekly downloads
 
Created
Source

hapi-pino

Hapi plugin for the Pino logger. It logs in JSON for easy post-processing. It is faster than good console logger by a 25% factor (40% when using extreme mode

Install

npm i hapi-pino --save

Usage

'use strict'

const Hapi = require('hapi')

// Create a server with a host and port
const server = new Hapi.Server()
server.connection({
  host: 'localhost',
  port: 3000
})

server.register({
  register: require('pino').register,
  options: {
    extreme: true // default false
  }
}, (err) => {
  if (err) {
    throw err
  }
})

// Add the route
server.route({
  method: 'GET',
  path: '/',
  handler: function (request, reply) {
    request.logger.info('a word from the handler')
    return reply('hello world')
  }
})

// Start the server
server.start((err) => {
  if (err) {
    throw err
  }
  server.app.logger.info('logging with Pino')
})

Acknowledgements

This project was kindly sponsored by nearForm.

License

MIT

Keywords

FAQs

Package last updated on 18 Apr 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

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