FileSystemProvider

interface

Abstracts file-system and path operations so the parser and CLI layer
can run in environments without Node's fs / path modules
(e.g. browsers with an in-memory virtual FS).

Methods

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

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

basename(path: string): string

Return the final segment of `path`.

dirname(path: 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(dir: string, options?: { recursive?: boolean }): 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`.