UNPKG

@modernpoacher/hapi-common-log

Version:

Transforms a Hapi request to a Common Log Format log line

39 lines (31 loc) 556 B
const debug = require('debug') const log = debug('@modernpoacher/hapi-common-log') const { env: { NODE_ENV = 'development' } } = process log('`@modernpoacher/hapi-common-log` is awake') function env () { log({ NODE_ENV }) return ( NODE_ENV === 'production' ) } module.exports = (api) => { if (api) api.cache.using(env) return { presets: [ [ '@babel/env', { targets: { node: 'current' }, useBuiltIns: 'usage', corejs: 3 } ] ] } }