Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rotating-file-stream

Package Overview
Dependencies
Maintainers
2
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rotating-file-stream - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

40

index.js

@@ -15,18 +15,4 @@ "use strict";

if(! options)
options = {};
else {
if(typeof options != "object")
throw new Error("Don't know how to handle 'options' type: " + typeof options);
options = utils.checkOptions(options);
var tmp = {};
for(var i in options)
tmp[i] = options[i];
options = tmp;
}
utils.checkOptions(options);
if(typeof filename == "function")

@@ -142,2 +128,26 @@ this.generator = filename;

RotatingFileStream.prototype.end = function() {
var args = [];
for(var i in arguments) {
if("function" == typeof arguments[i]) {
this.once("finish", arguments[i]);
break;
}
if(i > 1)
break;
args.push(arguments[i]);
}
this.ending = true;
if(args.length)
this.write.apply(this, args);
else
this._rewrite();
};
RotatingFileStream.prototype.firstOpen = function() {

@@ -144,0 +154,0 @@ var self = this;

{
"name": "rotating-file-stream",
"version": "1.1.2",
"version": "1.1.3",
"description": "Opens a stream.Writable to a file rotated by interval and/or size. A logrotate alternative.",

@@ -11,3 +11,3 @@ "engines": {

"jshint": "./node_modules/.bin/jshint *.js test",
"npmignore": "echo '.jshintrc\\n.gitignore\\n.travis.yml\\ntest\\nsleep.js' > .npmignore ; cat .gitignore >> .npmignore",
"npmignore": "echo '.gitignore\\n.jshintrc\\n.travis.yml\\nsleep.js\\ntest' > .npmignore ; cat .gitignore >> .npmignore",
"t": "./node_modules/.bin/_mocha test",

@@ -14,0 +14,0 @@ "test": "npm run npmignore && npm run jshint && npm run coverage"

@@ -132,2 +132,10 @@ "use strict";

function checkOptions(options) {
if(! options)
return {};
if(typeof options != "object")
throw new Error("Don't know how to handle 'options' type: " + typeof options);
var ret = {};
for(var opt in options) {

@@ -140,4 +148,7 @@ var val = options[opt];

checks[opt](typ, options, val);
ret[opt] = options[opt];
checks[opt](typ, ret, val);
}
return ret;
}

@@ -199,11 +210,2 @@

});
self.end = function(chunk, encoding, callback) {
self.ending = true;
if(chunk)
self.write(chunk, encoding, callback);
else
self._rewrite();
};
}

@@ -210,0 +212,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc