Skip to content

Commit

Permalink
deps: write-file-atomic@4.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzy committed Aug 17, 2022
1 parent cbee638 commit 1f6daf5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 17 deletions.
13 changes: 10 additions & 3 deletions node_modules/write-file-atomic/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ function cleanupOnExit (tmpfile) {
return () => {
try {
fs.unlinkSync(typeof tmpfile === 'function' ? tmpfile() : tmpfile)
} catch (_) {}
} catch {
// ignore errors
}
}
}

Expand Down Expand Up @@ -156,15 +158,20 @@ async function writeFileAsync (filename, data, options = {}) {
}
}

function writeFile (filename, data, options, callback) {
async function writeFile (filename, data, options, callback) {
if (options instanceof Function) {
callback = options
options = {}
}

const promise = writeFileAsync(filename, data, options)
if (callback) {
promise.then(callback, callback)
try {
const result = await promise
return callback(result)
} catch (err) {
return callback(err)
}
}

return promise
Expand Down
24 changes: 13 additions & 11 deletions node_modules/write-file-atomic/package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"name": "write-file-atomic",
"version": "4.0.1",
"version": "4.0.2",
"description": "Write files in an atomic fashion w/configurable ownership",
"main": "./lib/index.js",
"scripts": {
"test": "tap",
"posttest": "npm run lint",
"lint": "eslint '**/*.js'",
"postlint": "npm-template-check",
"lint": "eslint \"**/*.js\"",
"postlint": "template-oss-check",
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
"lintfix": "npm run lint -- --fix",
"snap": "tap",
"template-copy": "npm-template-copy --force"
"template-oss-apply": "template-oss-apply --force"
},
"repository": {
"type": "git",
"url": "git://github.com/npm/write-file-atomic.git"
"url": "https://github.com/npm/write-file-atomic.git"
},
"keywords": [
"writeFile",
Expand All @@ -34,20 +34,22 @@
"signal-exit": "^3.0.7"
},
"devDependencies": {
"@npmcli/template-oss": "^2.7.1",
"@npmcli/eslint-config": "^3.0.1",
"@npmcli/template-oss": "3.5.0",
"mkdirp": "^1.0.4",
"rimraf": "^3.0.2",
"tap": "^15.1.6"
"tap": "^16.0.1"
},
"files": [
"bin",
"lib"
"bin/",
"lib/"
],
"engines": {
"node": "^12.13.0 || ^14.15.0 || >=16"
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"windowsCI": false,
"version": "2.7.1"
"version": "3.5.0"
}
}
7 changes: 4 additions & 3 deletions package-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -9824,15 +9824,16 @@
"license": "ISC"
},
"node_modules/write-file-atomic": {
"version": "4.0.1",
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz",
"integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==",
"inBundle": true,
"license": "ISC",
"dependencies": {
"imurmurhash": "^0.1.4",
"signal-exit": "^3.0.7"
},
"engines": {
"node": "^12.13.0 || ^14.15.0 || >=16"
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
}
},
"node_modules/ws": {
Expand Down

0 comments on commit 1f6daf5

Please sign in to comment.