Utilities described in this article will essentially improve your daily work with a file system. Below, you will find 17 time-tested Node.js filesystem tools, which are widely used within the community. If you are going to streamline routine tasks related to a file system, you’ve come to the right place. Additionally, we recommend you to check the 75 best Node.js command line apps and utilities.
The name of this filesystem Node.js tool speaks of its purpose. The del utility will help you get rid of both files and folders with the help of globs. Although it looks like rimraf, but the Node.js tool adds a Promise API and protects the filesystem against deleting your current working directory.
If your glob files still lacks support for multiple patterns, then this Node.js filesystem utility is a must have addition to your set of Node.js tools. It not only extends glob with multiple patterns support, but exposes a Promise API as well.
Streamline one of the most often processes performed within every file system – copying files. With the cry Node.js filesystem tool, you will be able to speed up this process by leveraging streams, resilient it by using graceful-fs, and make copying files user-friendly with the aid of globs and non-existent destination directories. Besides, the utility uses good-looking error messages.
Improve your file system with the ability to create directories like mkdir -p recursively right in Node.js. Install this little filesystem utility and get the desired feature.
The graceful-fs Node.js filesystem tool acts as a drop-in replacement for the FS module. Besides, it adds a lot of improvements aimed at normalizing behavior across various platforms and environments. As a result, you get filesystem access that is more resilient to all possible errors.
This one is a reliable filesystem watcher which not only stabilizes events from fs.watch and fs.watchFile, but also enables using native fsevents on OS X. Chokidar resolves the following problems:
fs.watch doesn’t report filenames and events in Sublime on OS X; reports events twice; and emits most changes as rename;
fs.watchFile: behaves as bad at event handling; does not offer any recursive watching; leads to high CPU utilization.
Another useful Node.js tool designed to simplify your work with a file system is find-up. This tiny utility enables walking up parent directories to find a file you are looking for.
Reading and parsing JSON files is a piece of cake with the load-json-file Node.js filesystem utility. It strips UTF-8 BOM, utilizes graceful-fs, and shows more helpful errors, essentially improving your daily routine.
If you are looking for the ability to stringify and write JSON to files with all needed directories atomically, than give this filesystem Node.js utility a go, since it provides the aforementioned features.
This tool provides the same features as fs.createWriteStream() offers,but performs everything atomically. Besides writing to a tmp file, it runs an atomic fs.rename to transfer this file into a place when it has been created.
The filenamify Node.js filesystem utility converts a string to a valid filename. Such a tiny addition will help you simplify your daily work with a file system.
If you are looking for a fast way to determine whether a file is comprised of binary or text, give this Node.js filesystem tool a try. It provides this exact functionality.
Since the fs library of Node.js is a very low level solution, it can provide a lot of headache related to your daily work. But you can easily fix the problem with the fs-jetpack Node.js filesystem utility. The tool offers a completely revamped API designed for streamlined working processes within your file system.
Being a drop-in replacement for fs, fs-extra Node.js tool adds file system methods that are not common to the native fs module. Extra methods are related to remove(), copy(), mkdirs(), etc.
The pkg-dir filesystem utility introduces the most convenient way to find the root directory of your npm packages. It is a fast and easy solution that essentially changes one of your daily tasks within a file system.
_________
This was our digest of the best Node.js filesystem tools, apps, and utilities. What software solutions do you use? What tools should be added to the post? Share your thoughts in comments – we are always happy to hear from you.