fs.openSync()

fs.openSync(path, flags[, mode]) Synchronous version of fs.open(). Returns an integer representing the file descriptor.

fs.open()

fs.open(path, flags[, mode], callback) Asynchronous file open. See open(2). flags can be: 'r' - Open file for reading. An exception occurs if the file does not exist. 'r+' - Open file for reading and writing. An exception occurs if the file does not exist. 'rs' - Open file for reading in synchronous mode. Instructs the operating system to bypass the local file system cache. This is primarily useful for opening files on NFS mounts as it allows you to skip the potentially stale local cache.

fs.mkdtempSync()

fs.mkdtempSync(template) The synchronous version of [fs.mkdtemp()][]. Returns the created folder path.

fs.mkdtemp()

fs.mkdtemp(prefix, callback) Creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory. The created folder path is passed as a string to the callback's second parameter. Example: fs.mkdtemp('/tmp/foo-', (err, folder) => { console.log(folder); // Prints: /tmp/foo-itXde2 });

fs.mkdirSync()

fs.mkdirSync(path[, mode]) Synchronous mkdir(2). Returns undefined.

fs.mkdir()

fs.mkdir(path[, mode], callback) Asynchronous mkdir(2). No arguments other than a possible exception are given to the completion callback. mode defaults to 0o777.

fs.lstatSync()

fs.lstatSync(path) Synchronous lstat(2). Returns an instance of fs.Stats.

fs.lstat()

fs.lstat(path, callback) Asynchronous lstat(2). The callback gets two arguments (err, stats) where stats is a fs.Stats object. lstat() is identical to stat(), except that if path is a symbolic link, then the link itself is stat-ed, not the file that it refers to.

fs.linkSync()

fs.linkSync(srcpath, dstpath) Synchronous link(2). Returns undefined.

fs.link()

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