Skip to main content
The Deno 2 Release Candidate is here
Learn more
Latest
class VFS
import { VFS } from "https://deno.land/x/sptaki@1.2.0/utils/VFS.d.ts";

Constructors

new
VFS(asyncQueue: IAsyncQueue)

Properties

private
isBuffer
protected
asyncQueue: IAsyncQueue
accessFilePromisify: (path: fs.PathLike, mode?: number) => Promise<void>
copyFilePromisify: (
src: fs.PathLike,
dst: fs.PathLike,
flags?: number,
) => Promise<void>
mkdirPromisify: (path: fs.PathLike, options: fs.MakeDirectoryOptions & { recursive: true; }) => Promise<string>
readdirPromisify: (path: fs.PathLike, options?: BufferEncoding | { encoding: BufferEncoding; withFileTypes?: false; }) => Promise<string[]>
readFilePromisify: (path: fs.PathLike) => Promise<Buffer>
renamePromisify: (oldPath: fs.PathLike, newPath: fs.PathLike) => Promise<void>
rmdirPromisify: (path: fs.PathLike) => Promise<void>
statPromisify: (path: fs.PathLike, options?: fs.StatOptions & { bigint?: false; }) => Promise<fs.Stats>
unlinkPromisify: (path: fs.PathLike) => Promise<void>
writeFilePromisify: (
path: fs.PathLike,
data: string,
options?: any,
) => Promise<void>

Methods

protected
checkFileSync(filepath: any): boolean
protected
lockFileSync(filepath: any): () => void
protected
unlockFileSync(filepath: any): void
copyAsync(filepath: fs.PathLike, target: fs.PathLike): Promise<void>
copyDir(
filepath: string,
target: string,
fileExtensions?: string | string[],
): void
copyDirAsync(
filepath: string,
target: string,
fileExtensions: string | string[],
): Promise<void>
copyFile(filepath: fs.PathLike, target: fs.PathLike): void
createDir(filepath: string): void
createDirAsync(filepath: string): Promise<void>
exists(filepath: fs.PathLike): boolean
existsAsync(filepath: fs.PathLike): Promise<boolean>
getDirs(filepath: string): string[]
getDirsAsync(filepath: string): Promise<string[]>
getFileExtension(filepath: string): string
getFiles(filepath: string): string[]
getFilesAsync(filepath: string): Promise<string[]>
getFilesOfType(
directory: string,
fileType: string,
files?: string[],
): string[]
minifyAllJsonInDirRecursive(filepath: string): Promise<void>
minifyAllJsonInDirRecursiveAsync(filepath: string): Promise<void>
readFile(...args: Parameters<fs.readFileSync>): string
readFileAsync(path: fs.PathLike): Promise<string>
removeDir(filepath: string): void
removeDirAsync(filepath: string): Promise<void>
removeFile(filepath: string): void
removeFileAsync(filepath: string): Promise<void>
rename(oldPath: string, newPath: string): void
renameAsync(oldPath: string, newPath: string): Promise<void>
stripExtension(filepath: string): string
writeFile(
filepath: any,
data?: string,
append?: boolean,
atomic?: boolean,
): void
writeFileAsync(
filepath: any,
data?: string,
append?: boolean,
atomic?: boolean,
): Promise<void>