Socket
Socket
Sign inDemoInstall

fs-write-stream-atomic

Package Overview
Dependencies
2
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

23

index.js

@@ -58,11 +58,11 @@ var fs = require('graceful-fs')

if (ev === 'finish') {
atomicDoStuff.call(this, function (er) {
if (er)
cleanup.call(this, er)
else
fs.WriteStream.prototype.emit.call(this, 'finish')
}.bind(this))
// We handle emitting finish and close after the rename.
if (ev === 'close' || ev === 'finish') {
if (!this.__atomicDidStuff) {
atomicDoStuff.call(this, function (er) {
if (er)
cleanup.call(this, er)
}.bind(this))
}
}
// close will be emitted later, once we do the rename
}

@@ -90,4 +90,9 @@

cb(er)
fs.WriteStream.prototype.emit.call(this, 'close')
// emit finish, and then close on the next tick
// This makes finish/close consistent across Node versions also.
fs.WriteStream.prototype.emit.call(this, 'finish')
process.nextTick(function() {
fs.WriteStream.prototype.emit.call(this, 'close')
}.bind(this))
}.bind(this))
}
{
"name": "fs-write-stream-atomic",
"version": "1.0.1",
"version": "1.0.2",
"description": "Like `fs.createWriteStream(...)`, but atomic.",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc