Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pino-colada

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pino-colada - npm Package Compare versions

Comparing version 1.6.0 to 1.6.1

3

bin.js
#! /usr/bin/env node
var split = require('split2')
var pinoColada = require('./')()

@@ -8,3 +7,3 @@ var input = process.stdin

input
.pipe(split(pinoColada))
.pipe(pinoColada)
.pipe(output)

@@ -5,2 +5,3 @@ var prettyBytes = require('prettier-bytes')

var padLeft = require('pad-left')
var split = require('split2')
var chalk = require('chalk')

@@ -22,30 +23,13 @@ var nl = '\n'

function isObject (input) {
return Object.prototype.toString.apply(input) === '[object Object]'
}
function isPinoLog (log) {
return log && (log.hasOwnProperty('v') && log.v === 1)
}
module.exports = PinoColada
function PinoColada () {
return parse
return split(parse)
function parse (inputData) {
var obj
if (typeof inputData === 'string') {
var parsedData = jsonParse(inputData)
if (!parsedData.value || parsedData.err || !isPinoLog(parsedData.value)) {
return inputData + nl
}
obj = parsedData.value
} else if (isObject(inputData) && isPinoLog(inputData)) {
obj = inputData
} else {
return inputData + nl
}
function parse (line) {
var obj = jsonParse(line)
if (!obj.value || obj.err) return line + nl
obj = obj.value
if (!obj.level) return inputData + nl
if (!obj.level) return line + nl
if (!obj.message) obj.message = obj.msg

@@ -52,0 +36,0 @@ if (typeof obj.level === 'number') convertLogNumber(obj)

{
"name": "pino-colada",
"version": "1.6.0",
"version": "1.6.1",
"description": "cute ndjson logger for pino",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -21,13 +21,2 @@ # pino-colada 🍹

# Programmatic integration as [pino prettifier](http://getpino.io/#/docs/pretty?id=api-example)
```javascript
const pino = require('pino')
const logger = pino({
prettifier: require('pino-colada')
})
logger.info('hi')
```
# Install

@@ -34,0 +23,0 @@ ```bash

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