diff --git a/index.js b/index.js index d4a7544..7512e4c 100644 --- a/index.js +++ b/index.js @@ -177,7 +177,7 @@ function writeFileSync (filename, data, options) { const removeOnExitHandler = onExit(cleanup) try { - fd = fs.openSync(tmpfile, 'w', options.mode) + fd = fs.openSync(tmpfile, 'w', options.mode || 0o666) if (options.tmpfileCreated) { options.tmpfileCreated(tmpfile) }