1.2.0 • Published 8 years ago

cut-file-stream v1.2.0

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

Cut Log File Stream

Support morgan
Support timeZone

Install

npm install --save cut-file-stream

Usage

Format filename:

  • YYYY => Year
  • MM => Month
  • DD => Day
  • H => Hour
  • M => minute
  • S => Second

Cut file stream by day

var cts = require('cut-file-stream');
var stream = cfs.getStream({
    filename: 'custom-string-YYYYMMDD-custom-string.log',
    timeZone: 0 // UTC
});

Cut file stream by hour

var cts = require('cut-file-stream');
var stream = cfs.getStream({
    filename: 'custom-string-YYYYMMDDH-custom-string.log',
});

Cut file stream by minute

var cts = require('cut-file-stream');
var stream = cfs.getStream({
    filename: 'custom-string-YYYYMMDDHM-custom-string.log'
});

Get format datetime

var cts = require('cut-file-stream');
var stream = cts.getDateTime('YYYYMMDDHM');
// return 201507311230

If no filename, stdout will return

If no timeZone, default timeZone will be BeiJing: UTC+8

Bug fixed list

2015/07/31 Export method getDateTime 2015/07/16 Support multi log file steam

Contact

If you have any question, please contact me zhaoshuxiang2010@gmail.com

1.2.0

8 years ago

1.1.8

8 years ago

1.1.7

9 years ago

1.1.6

9 years ago

1.1.5

9 years ago

1.1.4

9 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago