Static
existsCheck if a file or directory exists
Static
isCheck if a path is readable
Static
isCheck if a path is writable
Static
getStatic
ensureEnsure directory exists, creating it if necessary
Static
readSafely read a file with encoding detection
Static
writeStatic
copyCopy a file with options
Static
moveMove a file with options
Static
deleteDelete a file safely
Static
listList files in a directory with filtering
Static
findFind markdown files in a directory
Static
createCreate a backup of a file
Static
getGet file size in bytes
Static
filesCheck if two files have the same content
Static
sanitizeGenerate a safe filename by removing invalid characters
Static
getGet relative path between two files
Utility class for common file system operations.
Provides a comprehensive set of static methods for file and directory manipulation, with proper error handling and cross-platform compatibility. All methods are async and use Node.js promises-based file system APIs.
Example
Basic file operations