Skip to content

FetchFS

Defined in: src/backends/fetch.ts:65

Internal

A simple filesystem backed by HTTP using the fetch API.

new FetchFS(index, baseUrl, requestInit?, remoteWrite?): FetchFS

Defined in: src/backends/fetch.ts:79

Index

string

RequestInit = {}

boolean

FetchFS

IndexFS.constructor

protected optional _mountPoint?: string

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

Internal

The last place this file system was mounted

IndexFS._mountPoint


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

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

Internal

The UUID of the file system.

IndexFS._uuid


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

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

FileSystemAttributes

IndexFS.attributes


protected baseUrl: string

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


readonly index: Index

Defined in: src/internal/index_fs.ts:26

IndexFS.index


optional label?: string

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

IndexFS.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

IndexFS.name


protected optional remoteWrite?: boolean

Defined in: src/backends/fetch.ts:83


protected requestInit: RequestInit = {}

Defined in: src/backends/fetch.ts:82


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

IndexFS.type

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

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

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

IndexFS.uuid

protected _async(p): void

Defined in: src/backends/fetch.ts:75

Queue an async operation started from a sync method. Failures aren’t rethrown to prevent further async ops from failing

Promise<unknown>

void


protected optional _mkdir(path, options): Promise<void>

Defined in: src/internal/index_fs.ts:184

string

CreationOptions

Promise<void>

IndexFS._mkdir


protected optional _mkdirSync(path, options): void

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

string

CreationOptions

void

IndexFS._mkdirSync


protected _remove(path, isUnlink): void

Defined in: src/internal/index_fs.ts:117

string

boolean

void

IndexFS._remove


protected create(path, options): Inode

Defined in: src/internal/index_fs.ts:154

string

CreationOptions

Inode

IndexFS.create


createFile(path, options): Promise<Inode>

Defined in: src/internal/index_fs.ts:176

Create the file at path with the given options.

string

CreationOptions

Promise<Inode>

IndexFS.createFile


createFileSync(path, options): Inode

Defined in: src/internal/index_fs.ts:180

Create the file at path with the given options.

string

CreationOptions

Inode

IndexFS.createFileSync


exists(path): Promise<boolean>

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

Test whether or not path exists.

string

Promise<boolean>

IndexFS.exists


existsSync(path): boolean

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

Test whether or not path exists.

string

boolean

IndexFS.existsSync


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

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

Internal

IoctlContext

number

any[]

Promise<any>

IndexFS.ioctl


ioctlSync(context, command, …args): any

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

Internal

IoctlContext

number

any[]

any

IndexFS.ioctlSync


link(target, link): Promise<void>

Defined in: src/internal/index_fs.ts:201

string

string

Promise<void>

IndexFS.link


linkSync(target, link): void

Defined in: src/internal/index_fs.ts:205

string

string

void

IndexFS.linkSync


mkdir(path, options): Promise<Inode>

Defined in: src/internal/index_fs.ts:187

string

CreationOptions

Promise<Inode>

IndexFS.mkdir


mkdirSync(path, options): Inode

Defined in: src/internal/index_fs.ts:194

string

CreationOptions

Inode

IndexFS.mkdirSync


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

Defined in: src/backends/fetch.ts:126

Reads into a buffer

string

Uint8Array

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

number = 0

number

The position in the file to stop reading

Promise<void>

IndexFS.read


readdir(path): Promise<string[]>

Defined in: src/internal/index_fs.ts:209

string

Promise<string[]>

IndexFS.readdir


readdirSync(path): string[]

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

string

string[]

IndexFS.readdirSync


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

Defined in: src/backends/fetch.ts:142

Reads into a buffer

string

Uint8Array

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

number = 0

number

The position in the file to stop reading

void

IndexFS.readSync


ready(): Promise<void>

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

Promise<void>

IndexFS.ready


readySync(): void

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

void

IndexFS.readySync


protected remove(path): Promise<void>

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

string

Promise<void>

IndexFS.remove


protected removeSync(path): void

Defined in: src/backends/fetch.ts:122

string

void

IndexFS.removeSync


rename(oldPath, newPath): Promise<void>

Defined in: src/internal/index_fs.ts:53

string

string

Promise<void>

IndexFS.rename


renameSync(oldPath, newPath): void

Defined in: src/internal/index_fs.ts:74

string

string

void

IndexFS.renameSync


protected resize(path, inode, oldSize): void | Promise<void>

Defined in: src/backends/fetch.ts:88

string

Inode

number

void | Promise<void>


rmdir(path): Promise<void>

Defined in: src/internal/index_fs.ts:139

string

Promise<void>

IndexFS.rmdir


rmdirSync(path): void

Defined in: src/internal/index_fs.ts:147

string

void

IndexFS.rmdirSync


stat(path): Promise<Inode>

Defined in: src/internal/index_fs.ts:95

string

Promise<Inode>

IndexFS.stat


statSync(path): Inode

Defined in: src/internal/index_fs.ts:101

string

Inode

IndexFS.statSync


streamRead(path, options): ReadableStream

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

Read a file using a stream.

string

StreamOptions

ReadableStream

IndexFS.streamRead


streamWrite(path, options): WritableStream

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

Write a file using stream.

string

StreamOptions

WritableStream

IndexFS.streamWrite


sync(): Promise<void>

Defined in: src/internal/index_fs.ts:217

Promise<void>

IndexFS.sync


syncSync(): void

Defined in: src/internal/index_fs.ts:219

void

IndexFS.syncSync


toString(): string

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

string

IndexFS.toString


touch(path, metadata): Promise<void>

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

Modify metadata.

string

InodeLike

Promise<void>

IndexFS.touch


touchSync(path, metadata): void

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

Modify metadata.

string

InodeLike

void

IndexFS.touchSync


unlink(path): Promise<void>

Defined in: src/internal/index_fs.ts:129

string

Promise<void>

IndexFS.unlink


unlinkSync(path): void

Defined in: src/internal/index_fs.ts:134

string

void

IndexFS.unlinkSync


usage(): UsageInfo

Defined in: src/internal/index_fs.ts:31

Default implementation.

UsageInfo

Implement

IndexFS.usage


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

Defined in: src/backends/fetch.ts:160

Writes a buffer to a file

string

Uint8Array

number

The offset in the file to start writing

Promise<void>

IndexFS.write


writeSync(path, data, offset): void

Defined in: src/backends/fetch.ts:169

Writes a buffer to a file

string

Uint8Array

number

The offset in the file to start writing

void

IndexFS.writeSync