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:140

Create a file.

string

CreationOptions

Promise<InodeLike<number>>

FileSystem.createFile


createFileSync(path, options): InodeLike

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

Create a file synchronously.

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:359

Internal

IoctlContext

number

any[]

Promise<any>

FileSystem.ioctl


ioctlSync(context, command, …args): any

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

Internal

IoctlContext

number

any[]

any

FileSystem.ioctlSync


link(target, link): Promise<void>

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

Create a hard link.

string

string

Promise<void>

FileSystem.link


linkSync(target, link): void

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

Create a hard link synchronously.

string

string

void

FileSystem.linkSync


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

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

Create a directory.

string

CreationOptions

Promise<InodeLike<number>>

FileSystem.mkdir


mkdirSync(path, options): InodeLike

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

Create a directory synchronously.

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:206

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:126

Read the contents of a directory.

string

Promise<string[]>

FileSystem.readdir


readdirSync(path): string[]

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

Read the contents of a directory synchronously.

string

string[]

FileSystem.readdirSync


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

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

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:41

Rename a file or directory.

string

string

Promise<void>

FileSystem.rename


renameSync(oldPath, newPath): void

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

Rename a file or directory synchronously.

string

string

void

FileSystem.renameSync


rmdir(path): Promise<void>

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

Remove a directory.

string

Promise<void>

FileSystem.rmdir


rmdirSync(path): void

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

Remove a directory synchronously.

string

void

FileSystem.rmdirSync


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

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

Get file statistics.

string

Promise<InodeLike<number>>

FileSystem.stat


statSync(path): InodeLike

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

Get file statistics synchronously.

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:340

Write a file using stream.

string

StreamOptions

WritableStream

FileSystem.streamWrite


sync(): Promise<void>

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

Synchronize data to the file system.

Promise<void>

FileSystem.sync


syncSync(): void

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

Synchronize data to the file system synchronously.

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:70

string

InodeLike

Promise<void>

FileSystem.touch


touchSync(path, metadata): void

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

string

InodeLike

void

FileSystem.touchSync


unlink(path): Promise<void>

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

Unlink (delete) a file.

string

Promise<void>

FileSystem.unlink


unlinkSync(path): void

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

Unlink (delete) a file synchronously.

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:220

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:225

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