Options
All
  • Public
  • Public/Protected
  • All
Menu

An adapter for NodeJS local filesystems using the fs module.

Hierarchy

  • NodeFSAdapter

Implements

  • Adapter

Index

Constructors

constructor

Properties

flushEnabled

flushEnabled: boolean

Enable or disable flushing the file system.

handle

handle: "node-fs"

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

journal

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>
  • Flush the underlying file system to prepare for a commit. This is a destructive operation unless flush is disabled.

    Returns Promise<void>

link

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

mkdir

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

read

  • read(path: string): Promise<Buffer>

remove

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

snapshot

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

    Parameters

    • path: string = '/'

    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