🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

write-file-atomic

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

write-file-atomic - npm Package Compare versions

Comparing version

to
1.0.2

2

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

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

@@ -5,6 +5,3 @@ write-file-atomic

This is an extension for node's `fs.writeFile` that makes its operation
atomic allows you to include uid/gid for the final file as well. It does
this by initially writing to a temporary file (your filename, followed by
".writeFile.atomic"), chowning it to the uid and gid you specified (if you
specified any) and finally renames it to your filename.
atomic and allows you set ownership (uid/gid of the file).

@@ -26,2 +23,8 @@ ### var writeFileAtomic = require('write-file-atomic')<br>writeFileAtomic(filename, data, [options], callback)

The file is initially named `filename + "." + md5hex(__filename, process.pid, ++invocations)`.
If writeFile completes successfully then, if passed the **chown** option it will change
the ownership of the file. Finally it renames the file back to the filename you specified. If
it encounters errors at any of these steps it will attempt to unlink the temporary file and then
pass the error back to the caller.
If provided, the **chown** option requires both **uid** and **gid** properties or else

@@ -28,0 +31,0 @@ you'll get an error.