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

sonic-boom

Package Overview
Dependencies
Maintainers
3
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sonic-boom

Extremely fast utf8 only stream implementation

  • 4.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.2M
decreased by-54.15%
Maintainers
3
Weekly downloads
 
Created

What is sonic-boom?

The 'sonic-boom' npm package is a fast and efficient logging library designed for Node.js. It is optimized for high-performance logging, making it suitable for applications that require rapid and concurrent log writing. The package provides a simple API for writing logs to files and supports features like file rotation and asynchronous logging.

What are sonic-boom's main functionalities?

Basic Logging

This feature allows you to create a basic logger that writes log messages to a specified file. The example demonstrates how to initialize the logger, write a log message, and close the logger.

const SonicBoom = require('sonic-boom');
const logger = new SonicBoom({ dest: './log.txt' });
logger.write('Hello, World!\n');
logger.end();

Asynchronous Logging

Sonic-boom supports asynchronous logging, which can improve performance by not blocking the event loop. The example shows how to enable asynchronous logging by setting the 'sync' option to false.

const SonicBoom = require('sonic-boom');
const logger = new SonicBoom({ dest: './log.txt', sync: false });
logger.write('This is an async log message.\n');
logger.end();

File Rotation

This feature allows you to rotate log files when they reach a certain size. The example demonstrates how to set a minimum length for log files and how to reopen a new log file for continued logging.

const SonicBoom = require('sonic-boom');
const logger = new SonicBoom({ dest: './log.txt', minLength: 4096 });
logger.write('Log message that triggers rotation.\n');
logger.reopen('./new-log.txt');

Other packages similar to sonic-boom

Keywords

FAQs

Package last updated on 29 Apr 2024

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