sudo-fs-promise
v1.0.1
Published
Promise wrapper for @mh-cbon/sudo-fs
Downloads
29
Readme
sudo-fs-promise
Simple promise wrapper for @mh-cbon/sudo-fs . Currently 1.0.17.
Installation
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
Example
var fs = require("sudo-fs-promise");
fs.readFile("./someFile")
.then(data => { console.log("data:", data); })
.catch(err => { console.log("err:", err); });
API
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(...)