Socket
Socket
Sign inDemoInstall

fast-file-rotate

Package Overview
Dependencies
20
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fast-file-rotate

A performant file transport providing daily log rotation for winston.


Version published
Weekly downloads
48
decreased by-37.66%
Maintainers
1
Install size
817 kB
Created
Weekly downloads
 

Readme

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

Last updated on 30 Sep 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc