Module

x/ts_morph/common/mod.ts>RuntimeFileSystem

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Go to Latest
interface RuntimeFileSystem
import { type RuntimeFileSystem } from "https://dotland.deno.dev/x/ts_morph@21.0.0/common/mod.ts";

Methods

isCaseSensitive(): boolean

Gets if this file system is case sensitive.

delete(path: string): Promise<void>

Asynchronously deletes the specified file or directory.

deleteSync(path: string): void

Synchronously deletes the specified file or directory

readDirSync(dirPath: string): RuntimeDirEntry[]

Reads all the child directories and files.

readFile(filePath: string, encoding?: string): Promise<string>

Asynchronously reads a file at the specified path.

readFileSync(filePath: string, encoding?: string): string

Synchronously reads a file at the specified path.

writeFile(filePath: string, fileText: string): Promise<void>

Asynchronously writes a file to the file system.

writeFileSync(filePath: string, fileText: string): void

Synchronously writes a file to the file system.

mkdir(dirPath: string): Promise<void>

Asynchronously creates a directory at the specified path.

mkdirSync(dirPath: string): void

Synchronously creates a directory at the specified path.

move(srcPath: string, destPath: string): Promise<void>

Asynchronously moves a file or directory.

moveSync(srcPath: string, destPath: string): void

Synchronously moves a file or directory.

copy(srcPath: string, destPath: string): Promise<void>

Asynchronously copies a file or directory.

copySync(srcPath: string, destPath: string): void

Synchronously copies a file or directory.

stat(path: string): Promise<RuntimeFileInfo | undefined>

Asynchronously gets the path's stat information.

statSync(path: string): RuntimeFileInfo | undefined

Synchronously gets the path's stat information.

getCurrentDirectory(): string

Gets the current directory of the environment.

glob(patterns: ReadonlyArray<string>): Promise<string[]>

Uses pattern matching to find files or directories.

globSync(patterns: ReadonlyArray<string>): string[]

Synchronously uses pattern matching to find files or directories.