Skip to content

NodeFsAdapter

Defined in: src/adapters/node/fs.ts:16

Adapter interface for filesystem operations

Used primarily for LFS progress tracking via GIT_LFS_PROGRESS.

Implements

Constructors

Constructor

new NodeFsAdapter(): NodeFsAdapter

Returns

NodeFsAdapter

Methods

createTempFile()

createTempFile(prefix): Promise<string>

Defined in: src/adapters/node/fs.ts:17

Create a temporary file and return its path

Parameters

prefix

string = 'type-git-'

Optional prefix for the temp file name

Returns

Promise<string>

Path to the created temporary file

Implementation of

FsAdapter.createTempFile


deleteDirectory()

deleteDirectory(dirPath): Promise<void>

Defined in: src/adapters/node/fs.ts:62

Delete a directory recursively

Parameters

dirPath

string

Path to the directory to delete

Returns

Promise<void>

Implementation of

FsAdapter.deleteDirectory


deleteFile()

deleteFile(filePath): Promise<void>

Defined in: src/adapters/node/fs.ts:58

Delete a file

Parameters

filePath

string

Path to the file to delete

Returns

Promise<void>

Implementation of

FsAdapter.deleteFile


exists()

exists(filePath): Promise<boolean>

Defined in: src/adapters/node/fs.ts:66

Check if a file exists

Parameters

filePath

string

Path to check

Returns

Promise<boolean>

Whether the file exists

Implementation of

FsAdapter.exists


readFile()

readFile(filePath): Promise<string>

Defined in: src/adapters/node/fs.ts:75

Read a file’s contents

Parameters

filePath

string

Path to the file

Returns

Promise<string>

File contents as string

Implementation of

FsAdapter.readFile


tail()

tail(options): Promise<void>

Defined in: src/adapters/node/fs.ts:22

Start tailing a file (watching for new lines)

Parameters

options

TailOptions

Tail options

Returns

Promise<void>

Promise that resolves when tailing stops

Implementation of

FsAdapter.tail


tailStreaming()

tailStreaming(filePath, options?): TailHandle

Defined in: src/adapters/node/fs.ts:83

Start tailing a file with streaming support

Parameters

filePath

string

Path to the file to tail

options?

Optional tail options

pollInterval?

number

signal?

AbortSignal

Returns

TailHandle

Handle to the tail operation

Implementation of

FsAdapter.tailStreaming


writeFile()

writeFile(filePath, contents): Promise<void>

Defined in: src/adapters/node/fs.ts:79

Write contents to a file

Parameters

filePath

string

Path to the file

contents

string

Contents to write

Returns

Promise<void>

Implementation of

FsAdapter.writeFile