MemoryFileSystemProvider

class

An in-memory file-system provider backed by a Record<string, string>.
Files are keyed by their full path; directories are inferred.

Properties

NameTypeDescription
readonly filesRecord<string, string>—

Methods

appendFileSync(path: string, data: string): void

Append `data` to the end of `path`.

basename(p: string): string

Return the final segment of `path`.

dirname(p: string): string

Return the directory portion of `path`.

existsSync(path: string): boolean

Check whether a file or directory exists at `path`.

join(parts: string[]): string

Join path segments with the platform separator.

mkdirSync(): void

Create `dir` and any missing parent directories.

readdirSync(dir: string): string[]

List the entries (file and directory names) inside `dir`.

readFileSync(path: string): string

Read the entire contents of `path` as a UTF-8 string.

resolve(parts: string[]): string

Resolve a sequence of paths into an absolute path.

writeFile(path: string, data: string): Promise<void>

Async version of writeFileSync.

writeFileSync(path: string, data: string): void

Overwrite (or create) `path` with `data`.