Socket
Socket
Sign inDemoInstall

write-file-atomic

Package Overview
Dependencies
3
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.3 to 1.3.4

20

index.js

@@ -69,6 +69,10 @@ 'use strict'

if (err) return cb(err)
var write = Buffer.isBuffer(data)
? function (_cb) { fs.write(fd, data, 0, data.length, _cb) }
: function (_cb) { fs.write(fd, data, encoding, _cb) }
write(function (err) {
if (Buffer.isBuffer(data)) {
return fs.write(fd, data, 0, data.length, 0, syncAndClose)
} else if (data != null) {
return fs.write(fd, String(data), 0, String(encoding), syncAndClose)
} else {
return syncAndClose()
}
function syncAndClose (err) {
if (err) return cb(err)

@@ -79,3 +83,3 @@ fs.fsync(fd, function (err) {

})
})
}
})

@@ -114,5 +118,5 @@ }

if (Buffer.isBuffer(data)) {
fs.writeSync(fd, data, 0, data.length)
} else {
fs.writeSync(fd, data, options.encoding || 'utf8')
fs.writeSync(fd, data, 0, data.length, 0)
} else if (data != null) {
fs.writeSync(fd, String(data), 0, String(options.encoding || 'utf8'))
}

@@ -119,0 +123,0 @@ fs.fsyncSync(fd)

6

package.json
{
"name": "write-file-atomic",
"version": "1.3.3",
"version": "1.3.4",
"description": "Write files in an atomic fashion w/configurable ownership",

@@ -32,4 +32,4 @@ "main": "index.js",

"rimraf": "^2.5.4",
"standard": "^5.4.1",
"tap": "^2.3.1"
"standard": "^9.0.2",
"tap": "^10.3.2"
},

@@ -36,0 +36,0 @@ "files": [

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