Socket
Socket
Sign inDemoInstall

pino-tiny

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pino-tiny - npm Package Compare versions

Comparing version 0.1.1 to 1.0.0

15

lib/logger.js

@@ -5,20 +5,21 @@ const debug = require('debug')('pino-tiny:logger')

const Pump = require('pump')
const Fs = require('fs')
const { getTransform } = require('./transformer')
const { parse, noop, shutdown } = require('./utils')
const { parse, noop } = require('./utils')
function start (options) {
debug('logging started')
const { exit, filter } = options
const { filter } = options
const transformer = Through.obj(getTransform(filter || noop))
const parser = Split(parse)
Pump(process.stdin, parser, transformer, process.stdout).on('error', console.error)
// https://github.com/pinojs/pino/pull/358
/* istanbul ignore next */
process.stdin.on('end', () => shutdown('input ended', exit))
/* istanbul ignore next */
process.on('SIGINT', () => shutdown('SIGINT', exit))
/* istanbul ignore next */
process.on('SIGTERM', () => shutdown('SIGTERM', exit))
if (!process.stdin.isTTY && !Fs.fstatSync(process.stdin.fd).isFile()) {
process.once('SIGINT', function noOp () { console.log() /* print a line after ^C */ })
}
}
module.exports = { start }

@@ -1,3 +0,1 @@

const debug = require('debug')('pino-tiny:utils')
function parse (line) {

@@ -18,11 +16,5 @@ try {

}
function shutdown (reason, exit) {
debug('logging stopped: %s', reason)
/* istanbul ignore if */
if (typeof exit === 'undefined' || exit) { // this is so it does not kill unit test
process.exit(0)
}
}
function noop (x) { return x }
module.exports = { noop, shutdown, parse }
module.exports = { noop, parse }
{
"name": "pino-tiny",
"version": "0.1.1",
"version": "1.0.0",
"description": "a very minimalistic output for pino logger",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

# pino-tiny
[![Build Status](https://travis-ci.com/holmok/pino-tiny.svg?branch=master)](https://travis-ci.com/github/holmok/pino-tiny/builds/)
a tiny little log formatter for [pino](https://github.com/pinojs/pino).

@@ -4,0 +7,0 @@

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