Options
All
  • Public
  • Public/Protected
  • All
Menu

An adapter for No-Operation; essentially makes the VFS a memory-only instance.

Hierarchy

  • MultiAdapter

Implements

  • Adapter

Index

Constructors

constructor

Properties

Private Readonly adapters

adapters: Adapter[]

The store of registered adapters

handle

handle: "multi"

The handle for this adapter, basically an id. Should be something simple but descriptive, like 'node-fs' or 'blob'.

journal

journal: Journal<JournalEntry>

Log useful messages to the journal about file operations.

Readonly root

root: string

The real root of this file system which will be committed to.

Methods

flush

  • flush(): Promise<void>

link

  • link(from: string, to: string, type: LinkType): Promise<void>

mkdir

  • mkdir(path: string): Promise<void>

read

  • read(path: string): Promise<Buffer>
  • Read a file from persistent storage; returns the first available non-empty result.

    Parameters

    • path: string

    Returns Promise<Buffer>

register

  • register(adapter: Adapter): void
  • Register an adapter. Any attempt to register an instance of MultiAdapter will be silently ignored.

    Parameters

    • adapter: Adapter

    Returns void

remove

  • remove(path: string, type: ItemType): Promise<void>

snapshot

  • snapshot(): AsyncGenerator<[string, SnapshotEntry], any, unknown>
  • Snapshot of the underlying file system; an asynchronous iterable which returns an entry of path and data. This is a no-op.

    Returns AsyncGenerator<[string, SnapshotEntry], any, unknown>

    The asynchronous iterable to get the snapshot.

write

  • write(path: string, contents?: Buffer): Promise<void>
  • Create a file or write the contents of a file to persistent storage.

    Parameters

    • path: string
    • Optional contents: Buffer

    Returns Promise<void>

Generated using TypeDoc