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.7 to 1.1.8

63

compress.js

@@ -5,3 +5,3 @@ "use strict";

var fs = require("fs");
var tmp = require("tmp");
var path = require("path");
var utils = require("./utils");

@@ -134,22 +134,48 @@ var zlib = require("zlib");

function external(src, dst, callback) {
var att = {};
var cont;
var self = this;
tmp.file({ keep: true, mode: parseInt("777", 8) }, function(err, path, fd, done) {
try { cont = self.options.compress(src, dst); }
catch(e) { return process.nextTick(callback.bind(null, e)); }
att[dst] = 1;
self.findName(att, true, function(err, name) {
if(err)
return callback(err);
var cb = function(err) {
done();
callback(err);
};
fs.write(fd, self.options.compress(src, dst), function(err) {
fs.open(name, "w", parseInt("777", 8), function(err, fd) {
if(err)
return cb(err);
return callback(err);
fs.close(fd, function(err) {
if(err)
return cb(err);
var close = fs.close.bind(fs, fd);
var unlink = fs.unlink.bind(fs, name, function(err) { if(err) self.emit("warning", err); });
cp.exec(path, cb);
fs.write(fd, cont, function(err) {
if(err) {
close(function(err) {
if(err)
self.emit("warning", err);
unlink();
});
return callback(err);
}
close(function(err) {
if(err) {
unlink();
return callback(err);
}
if(name.indexOf(path.sep) === -1)
name = "." + path.sep + name;
cp.exec(name, function(err) {
unlink();
callback(err);
});
});
});

@@ -195,8 +221,11 @@ });

if(name in attempts) {
attempts[name]++;
return self.findName(attempts, tmp, callback);
}
fs.stat(name, function(err) {
if((! err) || err.code !== "ENOENT") {
if(name in attempts)
attempts[name]++;
else
attempts[name] = 1;
attempts[name] = 1;

@@ -203,0 +232,0 @@ return self.findName(attempts, tmp, callback);

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

@@ -28,5 +28,2 @@ "scripts": {

"readmeFilename": "README.md",
"dependencies": {
"tmp": "0.0.31"
},
"devDependencies": {

@@ -33,0 +30,0 @@ "eslint": "3.15.0",

@@ -307,2 +307,4 @@ # rotating-file-stream

* 2017-02-13 - v1.1.8
* removed tmp dependecy due it was causing a strange instability now disappeared
* 2017-02-07 - v1.1.7

@@ -309,0 +311,0 @@ * fixed tmp.file call

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