diff --git a/index.js b/index.js index 3166654..7f370d9 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,7 @@ import path from 'path'; import os from 'os'; import fs from 'graceful-fs'; import {xdgConfig} from 'xdg-basedir'; -import writeFileAtomic from 'write-file-atomic'; +import {writeFileSync} from 'atomically'; import dotProp from 'dot-prop'; import uniqueString from 'unique-string'; @@ -43,7 +43,7 @@ export default class Configstore { // Empty the file if it encounters invalid JSON if (error.name === 'SyntaxError') { - writeFileAtomic.sync(this._path, '', writeFileOptions); + writeFileSync(this._path, '', writeFileOptions); return {}; } @@ -56,7 +56,7 @@ export default class Configstore { // Make sure the folder exists as it could have been deleted in the meantime fs.mkdirSync(path.dirname(this._path), mkdirOptions); - writeFileAtomic.sync(this._path, JSON.stringify(value, undefined, '\t'), writeFileOptions); + writeFileSync(this._path, JSON.stringify(value, undefined, '\t'), writeFileOptions); } catch (error) { // Improve the message of permission errors if (error.code === 'EACCES') { diff --git a/package.json b/package.json index e69e8d3..34bdd17 100644 --- a/package.json +++ b/package.json @@ -35,10 +35,10 @@ "save" ], "dependencies": { + "atomically": "^2.0.3", "dot-prop": "^6.0.1", "graceful-fs": "^4.2.6", "unique-string": "^3.0.0", - "write-file-atomic": "^3.0.3", "xdg-basedir": "^5.0.1" }, "devDependencies": {