Skip to content

PassthroughFS

Defined in: src/backends/passthrough.ts:18

Internal

Provides a consistent and easy to use internal API. Default implementations for exists and existsSync are included. If you are extending this class, note that every path is an absolute path and all arguments are present.

new PassthroughFS(nodeFS, prefix): PassthroughFS

Defined in: src/backends/passthrough.ts:19

NodeFS

string

PassthroughFS

FileSystem.constructor

protected optional _mountPoint?: string

Defined in: src/internal/filesystem.ts:162

Internal

The last place this file system was mounted

FileSystem._mountPoint


protected _uuid: `${string}-${string}-${string}-${string}-${string}`

Defined in: src/internal/filesystem.ts:169

Internal

The UUID of the file system.

FileSystem._uuid


readonly attributes: ConstMap<FileSystemAttributes, keyof FileSystemAttributes, void | CaseFold | undefined> & Map<string, any>

Defined in: src/internal/filesystem.ts:178

FileSystemAttributes

FileSystem.attributes


optional label?: string

Defined in: src/internal/filesystem.ts:156

FileSystem.label


readonly name: string

Defined in: src/internal/filesystem.ts:191

The name for this file system. For example, tmpfs for an in memory one

FileSystem.name


readonly nodeFS: NodeFS

Defined in: src/backends/passthrough.ts:20


readonly prefix: string

Defined in: src/backends/passthrough.ts:21


readonly type: number

Defined in: src/internal/filesystem.ts:185

A unique ID for this kind of file system. Currently unused internally, but could be used for partition tables or something

FileSystem.type

get uuid(): `${string}-${string}-${string}-${string}-${string}`

Defined in: src/internal/filesystem.ts:171

`${string}-${string}-${string}-${string}-${string}`

FileSystem.uuid

createFile(path, options): Promise<InodeLike<number>>

Defined in: src/backends/passthrough.ts:107

Create the file at path with the given options.

string

CreationOptions

Promise<InodeLike<number>>

FileSystem.createFile


createFileSync(path, options): InodeLike

Defined in: src/backends/passthrough.ts:118

Create the file at path with the given options.

string

CreationOptions

InodeLike

FileSystem.createFileSync


exists(path): Promise<boolean>

Defined in: src/internal/filesystem.ts:257

Test whether or not path exists.

string

Promise<boolean>

FileSystem.exists


existsSync(path): boolean

Defined in: src/internal/filesystem.ts:269

Test whether or not path exists.

string

boolean

FileSystem.existsSync


ioctl(context, command, …args): Promise<any>

Defined in: src/internal/filesystem.ts:365

Internal

IoctlContext

number

…any[]

Promise<any>

FileSystem.ioctl


ioctlSync(context, command, …args): any

Defined in: src/internal/filesystem.ts:373

Internal

IoctlContext

number

…any[]

any

FileSystem.ioctlSync


link(target, link): Promise<void>

Defined in: src/backends/passthrough.ts:144

string

string

Promise<void>

FileSystem.link


linkSync(target, link): void

Defined in: src/backends/passthrough.ts:148

string

string

void

FileSystem.linkSync


mkdir(path, options): Promise<InodeLike<number>>

Defined in: src/backends/passthrough.ts:89

string

CreationOptions

Promise<InodeLike<number>>

FileSystem.mkdir


mkdirSync(path, options): InodeLike

Defined in: src/backends/passthrough.ts:94

string

CreationOptions

InodeLike

FileSystem.mkdirSync


path(path): string

Defined in: src/backends/passthrough.ts:34

string

string


read(path, buffer, offset, end): Promise<void>

Defined in: src/backends/passthrough.ts:152

Reads into a buffer

string

Uint8Array

The buffer to read into. You must set the byteOffset and byteLength appropriately!

number

number

The position in the file to stop reading

Promise<void>

FileSystem.read


readdir(path): Promise<string[]>

Defined in: src/backends/passthrough.ts:99

string

Promise<string[]>

FileSystem.readdir


readdirSync(path): string[]

Defined in: src/backends/passthrough.ts:103

string

string[]

FileSystem.readdirSync


readSync(path, buffer, offset, end): void

Defined in: src/backends/passthrough.ts:157

Reads into a buffer

string

Uint8Array

The buffer to read into. You must set the byteOffset and byteLength appropriately!

number

number

The position in the file to stop reading

void

FileSystem.readSync


ready(): Promise<void>

Defined in: src/internal/filesystem.ts:213

Promise<void>

FileSystem.ready


readySync(): void

Defined in: src/internal/filesystem.ts:214

void

FileSystem.readySync


rename(oldPath, newPath): Promise<void>

Defined in: src/backends/passthrough.ts:38

string

string

Promise<void>

FileSystem.rename


renameSync(oldPath, newPath): void

Defined in: src/backends/passthrough.ts:42

string

string

void

FileSystem.renameSync


rmdir(path): Promise<void>

Defined in: src/backends/passthrough.ts:128

string

Promise<void>

FileSystem.rmdir


rmdirSync(path): void

Defined in: src/backends/passthrough.ts:132

string

void

FileSystem.rmdirSync


stat(path): Promise<InodeLike<number>>

Defined in: src/backends/passthrough.ts:46

string

Promise<InodeLike<number>>

FileSystem.stat


statSync(path): InodeLike

Defined in: src/backends/passthrough.ts:50

string

InodeLike

FileSystem.statSync


streamRead(path, options): ReadableStream

Defined in: src/internal/filesystem.ts:317

Read a file using a stream.

string

StreamOptions

ReadableStream

FileSystem.streamRead


streamWrite(path, options): WritableStream

Defined in: src/internal/filesystem.ts:346

Write a file using stream.

string

StreamOptions

WritableStream

FileSystem.streamWrite


sync(): Promise<void>

Defined in: src/backends/passthrough.ts:136

Promise<void>

FileSystem.sync


syncSync(): void

Defined in: src/backends/passthrough.ts:140

void

FileSystem.syncSync


toString(): string

Defined in: src/internal/filesystem.ts:197

string

FileSystem.toString


touch(path, metadata): Promise<void>

Defined in: src/backends/passthrough.ts:58

string

InodeLike

Promise<void>

FileSystem.touch


touchSync(path, metadata): void

Defined in: src/backends/passthrough.ts:72

string

InodeLike

void

FileSystem.touchSync


unlink(path): Promise<void>

Defined in: src/backends/passthrough.ts:81

string

Promise<void>

FileSystem.unlink


unlinkSync(path): void

Defined in: src/backends/passthrough.ts:85

string

void

FileSystem.unlinkSync


usage(): UsageInfo

Defined in: src/backends/passthrough.ts:26

Default implementation.

UsageInfo

Implement

FileSystem.usage


write(path, buffer, offset): Promise<void>

Defined in: src/backends/passthrough.ts:166

Writes a buffer to a file

string

Uint8Array

The buffer to write. You must set the byteOffset and byteLength appropriately!

number

The offset in the file to start writing

Promise<void>

FileSystem.write


writeSync(path, buffer, offset): void

Defined in: src/backends/passthrough.ts:171

Writes a buffer to a file

string

Uint8Array

The buffer to write. You must set the byteOffset and byteLength appropriately!

number

The offset in the file to start writing

void

FileSystem.writeSync