Simple promise wrapper for @mh-cbon/sudo-fs . Currently 1.0.17.
This is a Node.js module available through the
npm registry. Installation is done using the
npm install
command:
$ npm install sudo-fs-promise --save
var fs = require("sudo-fs-promise");
fs.readFile("./someFile")
.then(data => { console.log("data:", data); })
.catch(err => { console.log("err:", err); });
fs.createReadStream(fPath) .then(...)
fs.createWriteStream(fPath) .then(...)
fs.readFile(fPath, options) .then(...)
fs.writeFile(fPath, content, options) .then(...)
fs.touch(fPath, options) .then(...)
fs.unlink(fPath) .then(...)
fs.rmdir(fPath) .then(...)
fs.mkdir(fPath, mod) .then(...)
fs.chown(fPath, uid, gid) .then(...)
fs.chmod(fPath, mod) .then(...)
fs.exists(fPath) .then(...)