Skip to main content
Module

x/ts_morph/common/ts_morph_common.d.ts>TransactionalFileSystem

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Very Popular
Latest
class TransactionalFileSystem
import { TransactionalFileSystem } from "https://deno.land/x/ts_morph@22.0.0/common/ts_morph_common.d.ts";

FileSystemHost wrapper that allows transactionally queuing operations to the file system.

Constructors

new
TransactionalFileSystem(options: TransactionalFileSystemOptions)

Constructor.

Methods

Recreates a directory on the underlying file system asynchronously.

Recreates a directory on the underlying file system synchronously.

copyDirectoryImmediately(srcDirPath: StandardizedFilePath, destDirPath: StandardizedFilePath): Promise<void>
fileExists(filePath: StandardizedFilePath): boolean | Promise<boolean>
flush(): Promise<void>
flushSync(): void
getStandardizedAbsolutePath(fileOrDirPath: string, relativeBase?: string): StandardizedFilePath
glob(patterns: ReadonlyArray<string>): Promise<StandardizedFilePath[]>
globSync(patterns: ReadonlyArray<string>): Generator<StandardizedFilePath, void, unknown>
moveDirectoryImmediately(srcDirPath: StandardizedFilePath, destDirPath: StandardizedFilePath): Promise<void>
moveFileImmediately(
oldFilePath: StandardizedFilePath,
newFilePath: StandardizedFilePath,
fileText: string,
): Promise<void>
moveFileImmediatelySync(
oldFilePath: StandardizedFilePath,
newFilePath: StandardizedFilePath,
fileText: string,
): void
readFile(filePath: StandardizedFilePath, encoding: string | undefined): Promise<string>
readFileIfExists(filePath: StandardizedFilePath, encoding: string | undefined): Promise<string | undefined>
readFileIfExistsSync(filePath: StandardizedFilePath, encoding: string | undefined): string | undefined
readFileOrNotExists(filePath: StandardizedFilePath, encoding: string): false | Promise<string | false>
readFileOrNotExistsSync(filePath: StandardizedFilePath, encoding: string): string | false
readFileSync(filePath: StandardizedFilePath, encoding: string | undefined): string
saveForDirectory(dirPath: StandardizedFilePath): Promise<void>
writeFile(filePath: StandardizedFilePath, fileText: string): Promise<void>
writeFileSync(filePath: StandardizedFilePath, fileText: string): void