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

@types/bunyan

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/bunyan

TypeScript definitions for node-bunyan

  • 0.0.22-alpha
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
310K
decreased by-81.06%
Maintainers
1
Weekly downloads
 
Created

What is @types/bunyan?

@types/bunyan provides TypeScript type definitions for the Bunyan logging library, which is a simple and fast JSON logging library for Node.js services.

What are @types/bunyan's main functionalities?

Basic Logging

This feature allows you to create a basic logger and log messages at the 'info' level.

const bunyan = require('bunyan');
const log = bunyan.createLogger({name: 'myapp'});
log.info('Hello, world!');

Logging with Different Levels

This feature allows you to log messages at different levels such as trace, debug, info, warn, error, and fatal.

const bunyan = require('bunyan');
const log = bunyan.createLogger({name: 'myapp'});
log.trace('Trace message');
log.debug('Debug message');
log.info('Info message');
log.warn('Warn message');
log.error('Error message');
log.fatal('Fatal message');

Child Loggers

This feature allows you to create child loggers that inherit properties from the parent logger but can also have additional context-specific properties.

const bunyan = require('bunyan');
const log = bunyan.createLogger({name: 'myapp'});
const child = log.child({widget_type: 'foo'});
child.info('Hello from child logger');

Serializers

This feature allows you to use serializers to format log messages, such as including request and response objects in a structured way.

const bunyan = require('bunyan');
const log = bunyan.createLogger({name: 'myapp', serializers: bunyan.stdSerializers});
log.info({req: {method: 'GET', url: '/'}}, 'Request received');

Other packages similar to @types/bunyan

FAQs

Package last updated on 20 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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