rotating-file-stream
Advanced tools
Comparing version 2.0.2 to 2.1.0
@@ -0,1 +1,4 @@ | ||
- 2020-04-29 - v2.1.0 | ||
- **teeToStdout** option added | ||
- devDependencies update | ||
- 2020-01-26 - v2.0.2 | ||
@@ -2,0 +5,0 @@ - Fixed two [bugs](https://github.com/iccicci/rotating-file-stream/pull/47) |
@@ -19,2 +19,3 @@ /// <reference types="node" /> | ||
size?: string; | ||
teeToStdout?: boolean; | ||
} | ||
@@ -38,2 +39,3 @@ interface Opts { | ||
size?: number; | ||
teeToStdout?: boolean; | ||
} | ||
@@ -40,0 +42,0 @@ declare type Callback = (error?: Error) => void; |
@@ -98,2 +98,4 @@ "use strict"; | ||
}); | ||
if (this.options.teeToStdout) | ||
process.stdout.write(chunk.chunk, chunk.encoding, () => { }); | ||
}; | ||
@@ -640,3 +642,4 @@ if (this.stream) { | ||
rotate: buildNumberCheck("rotate"), | ||
size: buildStringCheck("size", checkSize) | ||
size: buildStringCheck("size", checkSize), | ||
teeToStdout: () => { } | ||
}; | ||
@@ -643,0 +646,0 @@ function checkOpts(options) { |
{ | ||
"name": "rotating-file-stream", | ||
"version": "2.0.2", | ||
"version": "2.1.0", | ||
"description": "Opens a stream.Writable to a file rotated by interval and/or size. A logrotate alternative.", | ||
@@ -42,12 +42,12 @@ "scripts": { | ||
"devDependencies": { | ||
"@types/mocha": "5.2.7", | ||
"@types/node": "13.5.0", | ||
"@typescript-eslint/eslint-plugin": "2.17.0", | ||
"@typescript-eslint/parser": "2.17.0", | ||
"@types/mocha": "7.0.2", | ||
"@types/node": "13.13.4", | ||
"@typescript-eslint/eslint-plugin": "2.30.0", | ||
"@typescript-eslint/parser": "2.30.0", | ||
"eslint": "6.8.0", | ||
"mocha": "7.0.1", | ||
"nyc": "15.0.0", | ||
"ts-node": "8.6.2", | ||
"typescript": "3.7.5" | ||
"mocha": "7.1.2", | ||
"nyc": "15.0.1", | ||
"ts-node": "8.9.1", | ||
"typescript": "3.8.3" | ||
} | ||
} |
# rotating-file-stream | ||
[![Build Status](https://travis-ci.org/iccicci/rotating-file-stream.png?branch=master)](https://travis-ci.org/iccicci/rotating-file-stream?branch=master) | ||
[![Code Climate](https://codeclimate.com/github/iccicci/rotating-file-stream/badges/gpa.svg)](https://codeclimate.com/github/iccicci/rotating-file-stream) | ||
[![Test Coverage](https://codeclimate.com/github/iccicci/rotating-file-stream/badges/coverage.svg)](https://codeclimate.com/github/iccicci/rotating-file-stream/coverage) | ||
[![Donate](https://img.shields.io/badge/donate-bitcoin-blue.svg)](https://blockchain.info/address/12p1p5q7sK75tPyuesZmssiMYr4TKzpSCN) | ||
[![Build Status][travis-badge]][travis-url] | ||
[![Code Climate][code-badge]][code-url] | ||
[![Test Coverage][cover-badge]][code-url] | ||
[![NPM version](https://badge.fury.io/js/rotating-file-stream.svg)](https://www.npmjs.com/package/rotating-file-stream) | ||
[![Dependencies](https://david-dm.org/iccicci/rotating-file-stream.svg)](https://david-dm.org/iccicci/rotating-file-stream) | ||
[![Dev Dependencies](https://david-dm.org/iccicci/rotating-file-stream/dev-status.svg)](https://david-dm.org/iccicci/rotating-file-stream?type=dev) | ||
[![NPM version][npm-badge]][npm-url] | ||
[![NPM downloads][npm-downloads-badge]][npm-url] | ||
[![Types][types-badge]][npm-url] | ||
[![Donate][donate-badge]][donate-url] | ||
[![NPM](https://nodei.co/npm/rotating-file-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/rotating-file-stream/) | ||
[![Dependencies][dep-badge]][dep-url] | ||
[![Dev Dependencies][dev-dep-badge]][dev-dep-url] | ||
[![Dependents][deps-badge]][npm-url] | ||
[code-badge]: https://codeclimate.com/github/iccicci/rotating-file-stream/badges/gpa.svg | ||
[code-url]: https://codeclimate.com/github/iccicci/rotating-file-stream | ||
[cover-badge]: https://codeclimate.com/github/iccicci/rotating-file-stream/badges/coverage.svg | ||
[dep-badge]: https://david-dm.org/iccicci/rotating-file-stream.svg | ||
[dep-url]: https://david-dm.org/iccicci/rotating-file-stream | ||
[deps-badge]: https://badgen.net/npm/dependents/rotating-file-stream?icon=npm | ||
[dev-dep-badge]: https://david-dm.org/iccicci/rotating-file-stream/dev-status.svg | ||
[dev-dep-url]: https://david-dm.org/iccicci/rotating-file-stream?type=dev | ||
[donate-badge]: https://badgen.net/badge/donate/bitcoin?icon=bitcoin | ||
[donate-url]: https://blockchain.info/address/12p1p5q7sK75tPyuesZmssiMYr4TKzpSCN | ||
[npm-downloads-badge]: https://badgen.net/npm/dm/rotating-file-stream?icon=npm | ||
[npm-badge]: https://badgen.net/npm/v/rotating-file-stream?color=green&icon=npm | ||
[npm-url]: https://www.npmjs.com/package/rotating-file-stream | ||
[travis-badge]: https://badgen.net/travis/iccicci/rotating-file-stream?icon=travis | ||
[travis-url]: https://travis-ci.org/iccicci/rotating-file-stream?branch=master | ||
[types-badge]: https://badgen.net/npm/types/rotating-file-stream?color=green&icon=typescript | ||
### Description | ||
@@ -170,4 +189,4 @@ | ||
**Note:** | ||
if all of [`options.interval`](#interval), [`options.size`](#size) and [`options.intervalBoundary`](#intervalBoundary) | ||
are used, returned _rotated file name_ **must** be function of both arguments `time` and `index`. | ||
if both of [`options.interval`](#interval) [`options.size`](#size) are used, returned _rotated file name_ **must** be | ||
function of both arguments `time` and `index`. | ||
@@ -189,3 +208,3 @@ #### filename(index) | ||
The `history` event is emitted once the _history check job _ is completed. | ||
The `history` event is emitted once the _history check job_ is completed. | ||
@@ -272,2 +291,5 @@ ### Event: 'open' | ||
Specifies the file size to rotate the file. **Default:** `null`. | ||
- [`teeToStdout`](#teeToStdout): | ||
[<boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) | ||
Writes file content to `stdout` as well. **Default:** `null`. | ||
@@ -287,2 +309,6 @@ ### encoding | ||
### teeToStdout | ||
If `true`, it makes the file content to be written to `stdout` as well. Useful for debugging puposes. | ||
### size | ||
@@ -351,3 +377,3 @@ | ||
**Note:** | ||
this option has effec only if [`options.interval`](#interval) is used. | ||
this option has effect only if [`options.interval`](#interval) is used. | ||
@@ -362,3 +388,3 @@ ### initialRotation | ||
**Note:** | ||
this option has effec only if [`options.intervalBoundary`](#intervalboundary) is used. | ||
this option has effect only if [`options.intervalBoundary`](#intervalboundary) is used. | ||
@@ -489,6 +515,6 @@ ### compress | ||
**while rotation job is running both the limits could be not respected**. The same can happen till the end of first | ||
rotation job* if [`options.maxFiles`](#maxfiles) or [`options.maxSize`](#maxsize) are changed between two runs. | ||
_rotation job_ if [`options.maxFiles`](#maxfiles) or [`options.maxSize`](#maxsize) are changed between two runs. | ||
The first check performed is the one against [`options.maxFiles`](#maxfiles), in case some files are removed, then the | ||
check against [`options.maxSize`](#maxsize) is performed, finally other files can be removed. When | ||
[`options.maxFiles`](#maxfiles) or [`options.maxSize`](#maxsize) are enabled for first time, an \_history file* can be | ||
[`options.maxFiles`](#maxfiles) or [`options.maxSize`](#maxsize) are enabled for first time, an _history file_ can be | ||
created with one _rotated filename_ (as returned by _filename generator function_) at each line. | ||
@@ -503,3 +529,3 @@ | ||
The package is tested under [all Node.js versions](https://travis-ci.org/iccicci/rotating-file-stream) | ||
currently supported accordingly to [Node.js Release](https://github.com/nodejs/Release). | ||
currently supported accordingly to [Node.js Release](https://github.com/nodejs/Release#readme). | ||
@@ -534,2 +560,3 @@ To work with the package under Windows, be sure to configure `bash.exe` as your _script-shell_. | ||
size?: string; | ||
teeToStdout?: boolean; | ||
} | ||
@@ -536,0 +563,0 @@ export declare class RotatingFileStream extends Writable {} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59300
813
574