rotating-file-stream
Advanced tools
+3
-0
@@ -0,1 +1,4 @@ | ||
| - 2020-01-26 - v2.0.2 | ||
| - Fixed two [bugs](https://github.com/iccicci/rotating-file-stream/pull/47) | ||
| - devDependencies update | ||
| - 2019-12-24 - v2.0.1 | ||
@@ -2,0 +5,0 @@ - Fixed a [bug about setTimeout on some node environments](https://github.com/iccicci/rotating-file-stream/pull/46) (thanks to [Rastopyr](https://github.com/Rastopyr)) |
+7
-1
@@ -79,2 +79,6 @@ "use strict"; | ||
| return destroy(this.error); | ||
| if (!this.stream) { | ||
| this.opened = rewrite; | ||
| return; | ||
| } | ||
| const done = (error) => { | ||
@@ -348,3 +352,5 @@ if (error) | ||
| const time = this.next - this.now().getTime(); | ||
| this.timer = time > this.maxTimeout ? timers_1.setTimeout(set, this.maxTimeout) : timers_1.setTimeout(() => this.rotate(error => (this.error = error)), time); | ||
| if (time <= 0) | ||
| return this.rotate(error => (this.error = error)); | ||
| this.timer = timers_1.setTimeout(set, time > this.maxTimeout ? this.maxTimeout : time); | ||
| this.timer.unref(); | ||
@@ -351,0 +357,0 @@ }; |
+7
-7
| { | ||
| "name": "rotating-file-stream", | ||
| "version": "2.0.1", | ||
| "version": "2.0.2", | ||
| "description": "Opens a stream.Writable to a file rotated by interval and/or size. A logrotate alternative.", | ||
@@ -43,11 +43,11 @@ "scripts": { | ||
| "@types/mocha": "5.2.7", | ||
| "@types/node": "13.1.0", | ||
| "@typescript-eslint/eslint-plugin": "2.13.0", | ||
| "@typescript-eslint/parser": "2.13.0", | ||
| "@types/node": "13.5.0", | ||
| "@typescript-eslint/eslint-plugin": "2.17.0", | ||
| "@typescript-eslint/parser": "2.17.0", | ||
| "eslint": "6.8.0", | ||
| "mocha": "6.2.2", | ||
| "mocha": "7.0.1", | ||
| "nyc": "15.0.0", | ||
| "ts-node": "8.5.4", | ||
| "typescript": "3.7.4" | ||
| "ts-node": "8.6.2", | ||
| "typescript": "3.7.5" | ||
| } | ||
| } |
-12
| const rfs = require("."); | ||
| const stream = rfs.createStream("file.log", { interval: "10s", compress: (source, dest) => `cat ${source} | gzip -c9 > ${dest}.gz`, maxFiles: 3 }); | ||
| const nothing = () => { | ||
| stream.write("test\n"); | ||
| setTimeout(nothing, 1000); | ||
| }; | ||
| stream.on("error", e => console.log("error", e)); | ||
| stream.on("warning", e => console.log("warning", e)); | ||
| nothing(); |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
58199
-0.19%6
-14.29%808
-0.37%