source: trip-planner-front/node_modules/streamroller/lib/RollingFileStream.js@ 188ee53

Last change on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 605 bytes
Line 
1const RollingFileWriteStream = require('./RollingFileWriteStream');
2
3// just to adapt the previous version
4class RollingFileStream extends RollingFileWriteStream {
5 constructor(filename, size, backups, options) {
6 if (!options) {
7 options = {};
8 }
9 if (size) {
10 options.maxSize = size;
11 }
12 if (!backups) {
13 backups = 1;
14 }
15 options.numToKeep = backups;
16 super(filename, options);
17 this.backups = this.options.numToKeep;
18 this.size = this.options.maxSize;
19 }
20
21 get theStream() {
22 return this.currentFileStream;
23 }
24
25}
26
27module.exports = RollingFileStream;
Note: See TracBrowser for help on using the repository browser.