Skip to content

Tag Archives: NodeJS-fs-extra

The ensureDirSync() function is the synchronous version of ensureDir() function. The function makes sure that the directory exists, if the directory structure does not exist… Read More
The ensureLinkSync() function is the synchronous version of ensureLink(). The function makes sure that the link between the two given files exists. The source file… Read More
The outputJson() function writes an object to the JSON file. If the user wants to write data onto a file that doesn’t exist it will… Read More
The readJson() function reads a JSON file and then parses it into an object. If the file does not exist it will throw an error.… Read More
The ensureDir() function make sure that the directory user is requesting exists. If the directory structure does not exist the function will create the structure… Read More
The emptyDirSync() function is the synchronous version of emptyDir() function. The function ensures that the given directory is empty. If the directory is not empty,… Read More
The move() function moves a file or a directory from source to the destination specified by the user. If you want to move a file… Read More
The outputFile() function writes the data onto the given file. It is similar to the writeFile() function except that if the file onto which the… Read More
The ensureLink() function ensures that the link between the given two files exists. If the destination file doesn’t exist it will be created and a… Read More
The pathExists() tests whether the given file path exists or not. It uses the fs.access() under the hood. Syntax: fs.pathExists(file,callback) Parameters: This function accepts two… Read More
Yhe remove() function deletes the given file or directory. All the files inside a directory are deleted. If the given file or directory does not… Read More
The ensureFile() function makes sure that the file user is requesting exists. If the file doesn’t exist the function will create a new file. Even… Read More
The fs-extra is a module that adds file system methods that are not included in the native fs module. It also adds promises support to… Read More