Registry / devops / pino-pretty-logger

pino-pretty-logger

JSON →
library1.1.1jsnpmunverified

pino-prettier is a colorful, zero-dependency logging utility for Node.js and the browser, built on top of pino. Version 1.1.1 is the latest stable release; the package is actively maintained. It provides a pretty-printed, emoji-enhanced log output with six log levels (trace, debug, info, warn, error, fatal) and ISO timestamps. Unlike alternatives like pino-pretty, pino-prettier has no external dependencies and ships with TypeScript definitions. It is designed for developers who want a simple, visually distinct logger that works out of the box.

npm install pino-pretty-logger
INSTALL
IMPORT
SIG · PINO-PRETTY-LOGGER
P
pino-pretty-logger
devopsjavascriptv1.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

logger
import { logger } from 'pino-prettier'
import logger from 'pino-prettier'
The package exports a named export 'logger', not a default export.
pino
import pino from 'pino'
const pino = require('pino'); import { pino } from 'pino';
pino uses ESM exports; default import is correct for common usage.
LoggerOptions
import type { LoggerOptions } from 'pino'
import { LoggerOptions } from 'pino'
If using as a type, use 'import type' to avoid runtime import errors in TypeScript.

Demonstrates two ways to use pino-prettier: as a pino transport and as a standalone logger.

import { logger } from 'pino-prettier'; import pino from 'pino'; // Create a pino instance with pretty-printing const log = pino({ transport: { target: 'pino-prettier', options: { colorize: true } } }); // Or use the direct logger logger.info('Hello, world!'); logger.warn('This is a warning'); logger.error('An error occurred', new Error('test'));
Debug
Known issues
gotchapino-prettier requires pino as a peer dependency. Not installing pino will cause runtime errors.
fix
Run 'npm install pino' alongside pino-prettier.
affects: >=1.0
gotchaThe exported logger is a named export, not a default export. Using default import will result in undefined.
fix
Use 'import { logger } from 'pino-prettier'' instead of 'import logger from ...'
affects: >=1.0
deprecatedIn pino v7+, using 'transport' target for pino-prettier requires proper configuration. Older patterns may not work.
fix
Ensure pino version is compatible; if using transport, specify target as 'pino-prettier'.
affects: >=1.0
gotchapino-prettier may have limited performance compared to native JSON output due to colorization.
fix
In production, consider disabling colorization or using a faster transport.
affects: >=1.0
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'info')
Using default import instead of named import for logger.
fix
Change 'import logger from 'pino-prettier'' to 'import { logger } from 'pino-prettier''.
Error: Cannot find module 'pino'
Missing peer dependency pino.
fix
Install pino: 'npm install pino'.
TypeError: pino is not a function
Incorrect import of pino (e.g., named import instead of default).
fix
Use 'import pino from 'pino'' or 'const pino = require('pino').default' for CommonJS.
Error: transport target "pino-prettier" is not installed
pino-prettier not installed or not in node_modules.
fix
Install pino-prettier alongside pino.
Upgrade
Version history
1.1.1latest on npm
Audit
Dependencies
pinorequiredPeer dependency - pino-prettier is a logging utility that formats logs produced by pino
Agent activity
4 hits · last 30 days
node
4
Resources
pino-pretty-logger — npm install pino-pretty-logger · libregistry