daily-file-writer
v1.0.1
Published
Write data to a log file using the date as the filename. Handles date rollover too!
Downloads
2
Readme
daily-file-writer
Write data to a log file using the date as the filename. Handles date rollover too!
Note: Requires Node.js v4+
Install
$ npm install [--save] daily-file-writer
Test
$ npm test
Usage
'use strict'
const Writer = require('daily-file-writer')
const writer = new Writer({
path: '/tmp/logs'
})
writer.write('blah blah')
// the log file will be something like:
// /tmp/logs/2016-01-02.txt
// when a write comes in and the date has changed,
// the previous file will be closed and the data will be written to a new file
// /tmp/logs/2016-01-03.txt
Author
Evan Lucas
License
MIT (See LICENSE
for more info)