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.0 to 1.3.1

16

index.js
'use strict'
module.exports = writeFile
module.exports.sync = writeFileSync
module.exports._getTmpname = getTmpname // for testing
var fs = require('graceful-fs')

@@ -8,7 +12,11 @@ var chain = require('slide').chain

var invocations = 0
var getTmpname = function (filename) {
return filename + '.' + MurmurHash3(__filename).hash(process.pid).hash(++invocations).result()
function getTmpname (filename) {
return filename + '.' +
MurmurHash3(__filename)
.hash(String(process.pid))
.hash(String(++invocations))
.result()
}
module.exports = function writeFile (filename, data, options, callback) {
function writeFile (filename, data, options, callback) {
if (options instanceof Function) {

@@ -58,3 +66,3 @@ callback = options

module.exports.sync = function writeFileSync (filename, data, options) {
function writeFileSync (filename, data, options) {
if (!options) options = {}

@@ -61,0 +69,0 @@ try {

{
"name": "write-file-atomic",
"version": "1.3.0",
"version": "1.3.1",
"description": "Write files in an atomic fashion w/configurable ownership",

@@ -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