1.0.1 • Published 8 years ago

daily-file-writer v1.0.1

Weekly downloads
8
License
MIT
Repository
github
Last release
8 years ago

daily-file-writer

Build Status Coverage Status

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)

1.0.1

8 years ago

1.0.0

8 years ago