1.1.0 • Published 5 years ago

daily-rotating-file-stream v1.1.0

Weekly downloads
21
License
MIT
Repository
github
Last release
5 years ago

daily-rotating-file-stream

Build Status Coverage Status NPM version JavaScript Style Guide

Installation

npm i daily-rotating-file-stream

API

DailyRotatingFileStream(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 (optional)

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

DailyRotatingFileStream#write(string)

Writes a string to the file.

DailyRotatingFileStream#flush()

Flushes the content of the buffer to the file.

DailyRotatingFileStream#destroy()

Destroys the stream.

DailyRotatingFileStream#end()

Flushes the data and ends the stream.

License

MIT