fs.exists()

fs.exists(path, callback) Stability: 0 - Deprecated: Use fs.stat() or fs.access() instead. Test whether or not the given path exists by checking with the file system. Then call the callback argument with either true or false. Example: fs.exists('/etc/passwd', (exists) => { console.log(exists ? 'it\'s there' : 'no passwd!'); }); fs.exists() should not be used to check if a file exists before calling fs.open(). Doing so introduces a race condition since other processes may change the file's

fs.createWriteStream()

fs.createWriteStream(path[, options]) Returns a new WriteStream object. (See Writable Stream). options is an object or string with the following defaults: { flags: 'w', defaultEncoding: 'utf8', fd: null, mode: 0o666, autoClose: true } options may also include a start option to allow writing data at some position past the beginning of the file. Modifying a file rather than replacing it may require a flags mode of r+ rather than the default mode w. The defaultEncoding can be any one o

fs.createReadStream()

fs.createReadStream(path[, options]) Returns a new ReadStream object. (See Readable Stream). Be aware that, unlike the default value set for highWaterMark on a readable stream (16 kb), the stream returned by this method has a default value of 64 kb for the same parameter. options is an object or string with the following defaults: { flags: 'r', encoding: null, fd: null, mode: 0o666, autoClose: true } options can include start and end values to read a range of bytes from the file in

fs.closeSync()

fs.closeSync(fd) Synchronous close(2). Returns undefined.

fs.close()

fs.close(fd, callback) Asynchronous close(2). No arguments other than a possible exception are given to the completion callback.

fs.chownSync()

fs.chownSync(path, uid, gid) Synchronous chown(2). Returns undefined.

fs.chown()

fs.chown(path, uid, gid, callback) Asynchronous chown(2). No arguments other than a possible exception are given to the completion callback.

fs.chmodSync()

fs.chmodSync(path, mode) Synchronous chmod(2). Returns undefined.

fs.chmod()

fs.chmod(path, mode, callback) Asynchronous chmod(2). No arguments other than a possible exception are given to the completion callback.

fs.appendFileSync()

fs.appendFileSync(file, data[, options]) The synchronous version of fs.appendFile(). Returns undefined.