mrdocs::files

Filesystem helpers (join, temp, real‐path resolution) used throughout MrDocs.

Description

The files namespace centralizes cross‐platform path manipulation so CLI, generators, and tests can share the same normalization and staging logic.

Enums

Name

Description

FileType

The type of a file.

Functions

Name

Description

appendPath

appendPath overloads

createDirectory

Create a directory.

exists

Determine if a path exists

getFileName

Return the filename part of the path.

getFileText

Return the contents of a file as a string.

getFileType

Return the file type or an error

getParentDir

Return the parent directory.

getSourceFilename

Return the relevant suffix of a source file path.

isAbsolute

Return true if pathName is absolute.

isDirectory

Determine if a path is a directory.

isDirsy

Return true if pathName ends in a separator.

isPosixStyle

Check if the path is posix style.

isRegularFile

Determine if a path is a regular file.

isResolvedSubpathOf

Checks whether the given path lies within the specified prefix, tolerating symlinks.

isSubpathOf

Checks whether the given path lies within the specified prefix.

looksLikeDirectory

Determine whether a path looks like a directory.

looksLikeFile

Determine whether a path looks like a file.

makeAbsolute

Return an absolute path from a possibly relative path.

makeDirsy

Append a trailing native separator if not already present.

makePosixStyle

Convert all backward slashes to forward slashes.

makeRealPath

Return the real, symlink‐resolved form of a path.

normalizeDir

Return a normalized directory.

normalizePath

Return a normalized path.

requireAbsolute

Return an error if pathName is not absolute.

requireDirectory

Return an error if the path is not a directory.

withExtension

Return the filename with a new or different extension.

Created with MrDocs