New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fast-file-rotate

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-file-rotate

A performant file transport providing daily log rotation for winston.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
88
increased by41.94%
Maintainers
1
Weekly downloads
 
Created
Source

fast-file-rotate

Build Status Coverage Status NPM version Greenkeeper badge JavaScript Style Guide

A performant file transport providing daily log rotation for winston.

Install

npm install fast-file-rotate

Example

const FileRotateTransport = require('fast-file-rotate');
const winston = require('winston');

const logger = winston.createLogger({
  transports: [
    new FileRotateTransport({
      fileName: __dirname + '/console%DATE%.log',
      dateFormat: 'DDMMYYYY'
    })
  ]
})

API

FileRotateTransport(options)

fileName

The name of the log file(s). Must contain a %DATE% placeholder.

dateFormat (optional)

The format of the date that will replace the placeholder %DATE% in the file name. Defaults to DDMMYYYY.
Supports all formating options of fast-date-format.

bufferSize

The size of the internal buffer that is used to store the logs before writing them to the file. Defaults to 4096.

Benchmark

The benchmark compares to the winston-daily-rotate-file module:

benchFastFileRotate*10000: 175.397ms
benchWinstonDailyRotateFile*10000: 580.341ms
benchFastFileRotate*10000: 141.746ms
benchWinstonDailyRotateFile*10000: 545.736ms

License

MIT

Keywords

FAQs

Package last updated on 30 Sep 2018

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