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

streamroller

Package Overview
Dependencies
Maintainers
2
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

streamroller

file streams that roll over when size limits, or dates are reached

  • 3.1.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.7M
decreased by-7.81%
Maintainers
2
Weekly downloads
 
Created

What is streamroller?

The streamroller npm package is a file-based logging utility designed to help manage log files by supporting automatic rolling of logs based on size or date. It is particularly useful for applications that generate a lot of log data and need to manage disk space efficiently.

What are streamroller's main functionalities?

Rolling file streams based on size

This feature allows you to create a log file that rolls over when it reaches a certain size. In the example, a new log file is created when the current log file reaches 10 MB. The '3' indicates that a maximum of three backup files are kept.

const StreamRoller = require('streamroller');
const stream = new StreamRoller.RollingFileStream('example.log', 1024 * 1024 * 10, 3);
stream.write('This is a log entry');
stream.end();

Rolling file streams based on date

This feature allows for log files to be rolled over based on date patterns. The 'yyyy-MM-dd' pattern means the log file will roll over daily. The 'daysToKeep' option specifies that logs older than 10 days should be deleted.

const StreamRoller = require('streamroller');
const stream = new StreamRoller.DateRollingFileStream('example.log', 'yyyy-MM-dd', { daysToKeep: 10 });
stream.write('This is a log entry');
stream.end();

Other packages similar to streamroller

Keywords

FAQs

Package last updated on 15 Feb 2023

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