sudo-fs-promise

Promise wrapper for @mh-cbon/sudo-fs


Keywords
fs, sudo, promise
License
ISC
Install
npm install sudo-fs-promise@1.0.1

Documentation

sudo-fs-promise

Simple promise wrapper for @mh-cbon/sudo-fs . Currently 1.0.17.

NPM Version NPM Downloads

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(...)

License

ISC