rotating-file-stream
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -0,1 +1,6 @@ | ||
- 2021-11-06 - v3.0.1 | ||
- `external` event emitted even if in error | ||
- exported `class RotatingFileStreamError` | ||
- Minor [README.md](https://github.com/iccicci/rotating-file-stream/blob/master/README.md) fixes | ||
- devDependencies update | ||
- 2021-11-04 - v3.0.0 | ||
@@ -2,0 +7,0 @@ - Released v3 - please check the [README.md](https://www.npmjs.com/package/rotating-file-stream#upgrading-from-v2-to-v3) |
/// <reference types="node" /> | ||
import { Readable, Writable } from "stream"; | ||
export declare class RotatingFileStreamError extends Error { | ||
code: string; | ||
constructor(); | ||
} | ||
export declare type Compressor = (source: string, dest: string) => string; | ||
@@ -4,0 +8,0 @@ export declare type Generator = (time: number | Date, index?: number) => string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createStream = exports.RotatingFileStream = void 0; | ||
exports.createStream = exports.RotatingFileStream = exports.RotatingFileStreamError = void 0; | ||
const child_process_1 = require("child_process"); | ||
@@ -20,2 +20,3 @@ const zlib_1 = require("zlib"); | ||
} | ||
exports.RotatingFileStreamError = RotatingFileStreamError; | ||
class RotatingFileStream extends stream_1.Writable { | ||
@@ -303,6 +304,4 @@ constructor(generator, options) { | ||
this.exec(compress(this.filename, filename), (error, stdout, stderr) => { | ||
if (error) | ||
return reject(error); | ||
this.emit("external", stdout, stderr); | ||
resolve(); | ||
error ? reject(error) : resolve(); | ||
}); | ||
@@ -309,0 +308,0 @@ }); |
{ | ||
"name": "rotating-file-stream", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Opens a stream.Writable to a file rotated by interval and/or size. A logrotate alternative.", | ||
@@ -47,3 +47,3 @@ "scripts": { | ||
"@typescript-eslint/parser": "5.3.0", | ||
"eslint": "8.1.0", | ||
"eslint": "8.2.0", | ||
"mocha": "9.1.3", | ||
@@ -50,0 +50,0 @@ "nyc": "15.1.0", |
@@ -104,3 +104,3 @@ # rotating-file-stream | ||
**Breaking change**: the way the _external compression command_ is executed was slightly changed; possible bracking | ||
**Breaking change**: the way the _external compression command_ is executed was slightly changed; possible breacking | ||
change. | ||
@@ -111,3 +111,3 @@ | ||
- using a _file name generator_ or not using [`options.compress`](#compress): nothing to do | ||
- using a _file name_ and using [`options.rotation`](#rotation): use [`options.omitExtension`](#omitextension) or check | ||
- using a _file name_ and using [`options.compress`](#compress): use [`options.omitExtension`](#omitextension) or check | ||
how rotated files are treated. | ||
@@ -114,0 +114,0 @@ |
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
58484
696