Skip to main content
Module

x/deno2node/src/deps.deno.ts>FileSystemHost

Compile your Deno project to run on Node.js.
Go to Latest
interface FileSystemHost
import { type FileSystemHost } from "https://deno.land/x/deno2node@v1.7.1/src/deps.deno.ts";

Represents a file system that can be interacted with.

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.

fileExists(filePath: string): Promise<boolean>

Asynchronously checks if a file exists.

fileExistsSync(filePath: string): boolean

Synchronously checks if a file exists.

directoryExists(dirPath: string): Promise<boolean>

Asynchronously checks if a directory exists.

directoryExistsSync(dirPath: string): boolean

Synchronously checks if a directory exists.

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.