Converts a file to a generative path format.
The name of the file to convert.
An object containing the inline data with base64 encoded content and MIME type.
Saves a file buffer to the specified file path on disk.
Calculates the file's hash, size, and MIME type, creates the necessary directories, and writes the file data to disk. Returns an object containing metadata about the saved file.
An object implementing the FileInterface, containing the file data, filename, and target filepath.
A promise that resolves to a FileStorageInterface object with file metadata, or null if saving fails.
StaticcalculateCalculates the SHA-256 hash of a given buffer.
The buffer to hash.
The SHA-256 hash as a hexadecimal string.
StaticcalculateCalculates the size of a file based on its buffer.
The buffer representing the file.
The size of the file in bytes.
StaticdownloadDownloads a file from a given URL and saves it to the specified download path.
The file download data including the file URL and save path.
The metadata of the downloaded file.
StaticexistsStaticexistsStaticmkdirCreates a directory if it does not exist.
The path of the directory to create.
StaticreadReads a JSON file and returns its content as an array.
The path to the JSON file.
An array of objects parsed from the JSON file.
StaticreadStaticrmRemoves a directory or file at the specified path. If the path is a directory, it will be removed recursively.
The path of the directory to remove.
StaticwatcherWatches a directory for file system events and executes a callback with the event details.
The options for the watcher.
The path of the directory to watch.
The type of event to listen for.
OptionalonEvent?: (Optional callback function to handle file system events.
StaticwriteWrites an object to a JSON file, appending it to an existing array if the file already exists.
StaticwriteOverwrites a JSON file with a new array of objects.
IOF (Input/Output File) class provides methods for file and directory operations, including creating directories, removing files, watching directories for changes, reading and writing JSON files, calculating file hashes and sizes, and saving files.