Test whether the current process can write to a directory.
Creates the directory if it doesn't exist, writes a temporary probe file,
then deletes it. Returns false if any step fails (permission denied, etc.).
Directory path to test write access for.
true if a file can be written and deleted in the directory.
Create a directory and any missing parent directories.
Absolute path of the directory to create.
Create a temporary directory in the system temp folder.
Directory name prefix (default: 'mj-install-').
Absolute path to the created temporary directory.
Check whether a path exists and is a directory.
Absolute path to check.
true if the path exists and is a directory, false otherwise.
Extract a ZIP file into a target directory.
Handles the common GitHub zipball convention where all files are nested
inside a single root folder (e.g., MemberJunction-MJ-abc1234/). When
a single root folder is detected, its contents are extracted directly
into targetDir without the wrapper folder.
Absolute path to the ZIP file.
Directory to extract into (created if it doesn't exist).
List of top-level entry names in the target directory after extraction.
Check whether a path exists and is a regular file.
Absolute path to check.
true if the path exists and is a file, false otherwise.
Recursively search for files with a specific name under a directory.
Skips node_modules and .git directories to avoid excessive traversal.
Used by PlatformCompatPhase to find all package.json files
in the workspace.
Root directory to start the search from.
Exact file name to match (e.g., 'package.json').
Maximum directory depth to recurse into (default: 3).
Array of absolute paths to matching files.
Get free disk space in bytes at a given path.
Walks up the directory tree to find an existing ancestor if dirPath
doesn't exist yet (common for fresh installs). Uses fs.statfs() to
query available blocks.
Path to check free space for (can be non-existent).
Available disk space in bytes.
Get the last-modified time of a file in milliseconds since the Unix epoch.
Used by CodeGenPhase's fast mode to compare source vs compiled file timestamps and determine whether post-codegen rebuilds are needed.
Absolute path to the file.
Modification time in milliseconds, or null if the file doesn't exist.
Check whether a directory is empty (contains no files or subdirectories).
Absolute path to the directory.
true if the directory is empty or doesn't exist, false otherwise.
List all entries (files and directories) in a directory. Returns an empty array if the directory doesn't exist.
List file names in a directory, optionally filtered by a regex pattern. Returns only regular files (not directories).
Absolute path to the directory.
Optionalpattern: RegExpOptional regex to filter file names (e.g., /environment.*\.ts$/).
Array of matching file names (not full paths). Empty if directory doesn't exist.
Read a file's raw bytes (no encoding interpretation). Useful for hashing or binary diffs where UTF-8 round-tripping would corrupt the content.
Absolute path to the file.
File content as a Uint8Array.
Read and parse a JSON file.
Expected shape of the parsed JSON.
Absolute path to the JSON file.
Parsed JSON content cast to type T.
Recursively remove a directory and all its contents.
Absolute path of the directory to remove.
Remove a single file. Silently succeeds if the file doesn't exist.
Absolute path of the file to remove.
Serialize data as JSON and write it to a file (pretty-printed, 2-space indent).
Absolute path to write the JSON file.
Data to serialize.
Write a UTF-8 text file, creating parent directories if needed.
Used for .env, SQL scripts, environment.ts, and manifest files.
Absolute path to write the file.
Text content to write.
File system adapter providing all I/O operations needed by installer phases.
Methods are organized into categories: