Registry / devops / pino-utils

pino-utils

JSON →
library1.4.0jsnpmunverified

pino-utils v1.4.0 is a zero-dependency, colorized logger utility for Node.js that provides a higher-level API over pino with emoji icons, ISO timestamps, and six log levels (trace, debug, info, warn, error, fatal). It ships TypeScript definitions and supports both ESM and CJS. Similar to pino-pretty but packaged as a standalone logger rather than a transport, it offers immediate usability without additional configuration. The package is actively maintained with a moderate release cadence and is ideal for projects wanting a prettified console logger without pulling in heavy formatters.

npm install pino-utils
INSTALL
IMPORT
SIG · PINO-UTILS
P
pino-utils
devopsjavascriptv1.4.0
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-utils'
const logger = require('pino-utils').logger
Default export is not available; logger is a named export. CommonJS require must access .logger property.
pino-utils (using require)
const { logger } = require('pino-utils')
const pinoUtils = require('pino-utils'); pinoUtils.logger.info('test')
Destructure directly in require to avoid extra variable.
TypeScript types
import type { Logger } from 'pino-utils'
Types are included; use import type for type-only imports to avoid bundling runtime code.

Demonstrates basic usage of the logger with all log levels, showing colorized and timestamped output.

import { logger } from 'pino-utils'; logger.info('Application started'); logger.debug('Debug info', { key: 'value' }); logger.warn('Warning!'); logger.error('Error occurred', new Error('Something went wrong')); logger.fatal('Fatal error'); // Output will be colorized with emoji and timestamp.
Debug
Known issues
gotchapino-utils is not a pino transport; it wraps pino internally. You cannot pipe pino streams directly.
fix
Use pino-pretty as a transport if you need to format pino streams. pino-utils is a standalone logger.
affects: >=1.0.0
gotchaThe logger object is a singleton. Importing in multiple modules returns the same instance.
fix
If you need separate loggers with different configurations, consider using pino directly or creating multiple instances via pino-utils API (if available in future versions).
affects: >=1.0.0
deprecatedThe default export is not available. Using `import pinoUtils from 'pino-utils'` returns undefined.
fix
Use named import: import { logger } from 'pino-utils'
affects: >=1.0.0
Errors
Common errors & fixes
SyntaxError: Cannot use import statement outside a module
Trying to use ESM import in a CommonJS Node.js project without proper configuration.
fix
Add "type": "module" to package.json or use require with destructuring: const { logger } = require('pino-utils')
TypeError: logger.info is not a function
Using default import instead of named import: import logger from 'pino-utils' (undefined).
fix
Use named import: import { logger } from 'pino-utils'
Upgrade
Version history
1.4.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
pino-utils — npm install pino-utils · libregistry