Skip to content

InMemoryFs

new InMemoryFs(initialFiles?): InMemoryFs;
Parameter Type

initialFiles?

InitialFiles

InMemoryFs

appendFile(path, content): Promise<void>;
Parameter Type

path

string

content

string | Uint8Array<ArrayBufferLike>

Promise<void>

FileSystem.appendFile


cp(
src,
dest,
options?): Promise<void>;
Parameter Type

src

string

dest

string

options?

CpOptions

Promise<void>

FileSystem.cp


exists(path): Promise<boolean>;
Parameter Type

path

string

Promise<boolean>

FileSystem.exists


glob(pattern): Promise<string[]>;
Parameter Type

pattern

string

Promise<string[]>

FileSystem.glob


lstat(path): Promise<FsStat>;
Parameter Type

path

string

Promise<FsStat>

FileSystem.lstat


mkdir(path, options?): Promise<void>;
Parameter Type

path

string

options?

MkdirOptions

Promise<void>

FileSystem.mkdir


mkdirSync(path, options?): void;
Parameter Type

path

string

options?

MkdirOptions

void


mv(src, dest): Promise<void>;
Parameter Type

src

string

dest

string

Promise<void>

FileSystem.mv


readdir(path): Promise<string[]>;
Parameter Type

path

string

Promise<string[]>

FileSystem.readdir


readdirWithFileTypes(path): Promise<FileSystemDirent[]>;
Parameter Type

path

string

Promise<FileSystemDirent[]>

FileSystem.readdirWithFileTypes


readFile(path, options?): Promise<string>;
Parameter Type

path

string

options?

| BufferEncoding | ReadFileOptions

Promise<string>

FileSystem.readFile


readFileBytes(path): Promise<Uint8Array<ArrayBufferLike>>;
Parameter Type

path

string

Promise<Uint8Array<ArrayBufferLike>>

FileSystem.readFileBytes


readlink(path): Promise<string>;
Parameter Type

path

string

Promise<string>

FileSystem.readlink


realpath(path): Promise<string>;
Parameter Type

path

string

Promise<string>

FileSystem.realpath


resolvePath(base, path): string;
Parameter Type

base

string

path

string

string

FileSystem.resolvePath


rm(path, options?): Promise<void>;
Parameter Type

path

string

options?

RmOptions

Promise<void>

FileSystem.rm


stat(path): Promise<FsStat>;
Parameter Type

path

string

Promise<FsStat>

FileSystem.stat


symlink(target, linkPath): Promise<void>;
Parameter Type

target

string

linkPath

string

Promise<void>

FileSystem.symlink


writeFile(
path,
content,
options?): Promise<void>;
Parameter Type

path

string

content

string

options?

| BufferEncoding | WriteFileOptions

Promise<void>

FileSystem.writeFile


writeFileBytes(path, content): Promise<void>;
Parameter Type

path

string

content

Uint8Array

Promise<void>

FileSystem.writeFileBytes


writeFileLazy(
path,
lazy,
metadata?): void;
Parameter Type

path

string

lazy

() => | string | Uint8Array<ArrayBufferLike> | Promise<string | Uint8Array<ArrayBufferLike>>

metadata?

{ mode?: number; mtime?: Date; }

metadata.mode?

number

metadata.mtime?

Date

void


writeFileSync(
path,
content,
options?,
metadata?): void;
Parameter Type

path

string

content

FileContent

options?

| BufferEncoding | WriteFileOptions

metadata?

{ mode?: number; mtime?: Date; }

metadata.mode?

number

metadata.mtime?

Date

void