pino
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
atomic-sleep | 1.0.0 | 2.76 kB | MIT | prod | |
fast-redact | 3.5.0 | 90.49 kB | MIT | prod | |
on-exit-leak-free | 2.1.2 | 3.57 kB | MIT | prod | |
pino-abstract-transport | 1.1.0 | 6.04 kB | MIT | prod | |
pino-std-serializers | 6.2.2 | 9.88 kB | MIT | prod | |
process-warning | 2.3.2 | 6.37 kB | MIT | prod | |
quick-format-unescaped | 4.0.4 | 3.97 kB | MIT | prod | |
real-require | 0.2.0 | 2.33 kB | MIT | prod | |
safe-stable-stringify | 2.4.3 | 6.97 kB | MIT | prod | |
sonic-boom | 3.8.1 | 81.01 kB | MIT | prod | |
thread-stream | 2.7.0 | 67.87 kB | MIT | prod |
Pino is a high-performance Node.js logging library known for its very low overhead. it's designed to be the fastest logger for Node.js with JSON outputs and offers extreme efficiency. Pino aims to provide the lowest cost, nearest to zero impact, logging experience for modern Node.js applications to ensure application speed is paramount. The usage of Pino can result in over 5x faster logging process than alternatives, making it a go-to choice for performance-conscious developers.
To use Pino in your application, first, you need to install it. If you're using the npm package manager, the installation can be done using the command npm install pino
. If you're a Yarn user, you can use the command yarn add pino
. After successfully installing Pino, you then require and instantiate it in your code. Here is a basic example of using Pino in your JavaScript code:
const logger = require('pino')()
logger.info('Hello world')
const child = logger.child({ a: 'property' })
child.info('Hello child!')
The example above will output two log lines, with the second line having an additional key-value pair "a:property". Pino supports child loggers which can be helpful for namespacing logs or adding additional data to all logs produced through the child logger.
Pino also offers integration with multiple web frameworks including Fastify, Express, Hapi, Restify, Koa, Node core http
, and Nest.
The Pino documentation provides a comprehensive guide and reference to its features and capabilities. The docs include information about benchmarks, APIs, usage in the browser, redaction, child loggers, transports, integration with web frameworks, pretty printing, asynchronous logging, and more. You can access the Pino documentation via their Github repository at git+https://github.com/pinojs/pino.git and navigate to their "docs" folder.