AnyMux

File System API reference

Exports of @anymux/file-system. Back to the module

Classes

Dirent

class

A representation of a directory entry, which can be a file or a subdirectory within the directory, as returned by reading from an `fs.Dir`. The directory entry is a combination of the file name and file type pairs. Additionally, when {@link readdir} or {@link readdirSync} is called with the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s.

class Dirent

isFile

method

Returns `true` if the `fs.Dirent` object describes a regular file.

isFile(): boolean

isDirectory

method

Returns `true` if the `fs.Dirent` object describes a file system directory.

isDirectory(): boolean

isBlockDevice

method

Returns `true` if the `fs.Dirent` object describes a block device.

isBlockDevice(): boolean

isCharacterDevice

method

Returns `true` if the `fs.Dirent` object describes a character device.

isCharacterDevice(): boolean

isSymbolicLink

method

Returns `true` if the `fs.Dirent` object describes a symbolic link.

isSymbolicLink(): boolean

isFIFO

method

Returns `true` if the `fs.Dirent` object describes a first-in-first-out (FIFO) pipe.

isFIFO(): boolean

isSocket

method

Returns `true` if the `fs.Dirent` object describes a socket.

isSocket(): boolean

name

property

The file name that this `fs.Dirent` object refers to. The type of this value is determined by the `options.encoding` passed to or .

name: Name

parentPath

property

The path to the parent directory of the file this `fs.Dirent` object refers to.

parentPath: string

path

property

Alias for `dirent.parentPath`.

path: string

MemoryFileSystem

class
class MemoryFileSystem

promises

property
promises: this

constants

property
constants: FSConstants

constructor

constructor
constructor(): MemoryFileSystem

init

method
init(): Promise<void>

readFile

method
readFile(path: string, options?: { encoding?: BufferEncoding; flag?: string; } | BufferEncoding): Promise<Buffer | string>

writeFile

method
writeFile(path: string, data: Buffer | string | Uint8Array, options?: { encoding?: BufferEncoding; mode?: number; flag?: string; }): Promise<void>

copyFile

method
copyFile(src: string, dest: string, mode?: number): Promise<void>

appendFile

method
appendFile(path: string, data: Buffer | string | Uint8Array, options?: { encoding?: BufferEncoding; mode?: number; flag?: string; }): Promise<void>

mkdir

method
mkdir(path: string, options?: { recursive?: boolean; mode?: number; }): Promise<string | undefined>

readdir

method
readdir(path: string, options?: { encoding?: BufferEncoding; withFileTypes?: false; recursive?: boolean; }): Promise<string[]>

readdir

method
readdir(path: string, options: { encoding?: BufferEncoding; withFileTypes: true; recursive?: boolean; }): Promise<Dirent[]>

readdir

method
readdir(path: string, options?: { encoding?: BufferEncoding; withFileTypes?: boolean; recursive?: boolean; }): Promise<string[] | Dirent[]>

rmdir

method
rmdir(path: string, options?: { maxRetries?: number; recursive?: boolean; retryDelay?: number; }): Promise<void>

stat

method
stat(path: string, options?: { bigint?: false; }): Promise<Stats>

stat

method
stat(path: string, options: { bigint: true; }): Promise<BigIntStats>

stat

method
stat(path: string, options?: { bigint?: boolean; }): Promise<Stats | BigIntStats>

lstat

method
lstat(path: string, options?: { bigint?: false; }): Promise<Stats>

lstat

method
lstat(path: string, options: { bigint: true; }): Promise<BigIntStats>

lstat

method
lstat(path: string, options?: { bigint?: boolean; }): Promise<Stats | BigIntStats>

rename

method
rename(oldPath: string, newPath: string): Promise<void>

unlink

method
unlink(path: string): Promise<void>

exists

method
exists(path: string): Promise<boolean>

access

method
access(path: string, mode?: number): Promise<void>

chmod

method
chmod(path: string, mode: string | number): Promise<void>

chown

method
chown(path: string, uid: number, gid: number): Promise<void>

readlink

method
readlink(path: string, options?: { encoding?: BufferEncoding; }): Promise<string>

symlink

method
symlink(target: string, path: string, type?: "dir" | "file" | "junction"): Promise<void>

link

method
link(existingPath: string, newPath: string): Promise<void>

truncate

method
truncate(path: string, len?: number): Promise<void>

utimes

method
utimes(path: string, atime: string | number | Date, mtime: string | number | Date): Promise<void>

rm

method
rm(path: string, options?: { force?: boolean; maxRetries?: number; recursive?: boolean; retryDelay?: number; }): Promise<void>

open

method
open(path: string, flags?: string | number, mode?: number): Promise<IFileHandle>

opendir

method
opendir(path: string, options?: { encoding?: BufferEncoding; bufferSize?: number; recursive?: boolean; }): Promise<IDir>

realpath

method
realpath(path: string, options?: { encoding?: BufferEncoding; }): Promise<string>

cp

method
cp(src: string, dest: string, options?: { dereference?: boolean; errorOnExist?: boolean; filter?: (src: string, dest: string) => boolean | Promise<boolean>; force?: boolean; mode?: number; preserveTimestamps?: boolean; recursive?: boolean; verbatimSymlinks?: boolean; }): Promise<void>

mkdtemp

method
mkdtemp(prefix: string, options?: { encoding?: BufferEncoding; }): Promise<string>

statfs

method
statfs(path: string, options?: { bigint?: false; }): Promise<StatFs>

statfs

method
statfs(path: string, options: { bigint: true; }): Promise<BigIntStatFs>

statfs

method
statfs(path: string, options?: { bigint?: boolean; }): Promise<StatFs | BigIntStatFs>

lutimes

method
lutimes(path: string, atime: string | number | Date, mtime: string | number | Date): Promise<void>

lchown

method
lchown(path: string, uid: number, gid: number): Promise<void>

lchmod

method
lchmod(path: string, mode: string | number): Promise<void>

createReadStream

method
createReadStream(path: string, options?: ReadStreamOptions): ReadStream

createWriteStream

method
createWriteStream(path: string, options?: WriteStreamOptions): WriteStream

watch

method
watch(path: string, options?: { encoding?: BufferEncoding; persistent?: boolean; recursive?: boolean; }): FSWatcher

isImplemented

method
isImplemented(method: string): boolean

_getNode

method
_getNode(path: string): MemoryNode | undefined

MemoryStats

class
class MemoryStats

dev

property
dev: number

ino

property
ino: number

mode

property
mode: number

nlink

property
nlink: number

uid

property
uid: number

gid

property
gid: number

rdev

property
rdev: number

size

property
size: number

blksize

property
blksize: number

blocks

property
blocks: number

atime

property
atime: Date

mtime

property
mtime: Date

ctime

property
ctime: Date

birthtime

property
birthtime: Date

isFile

method
isFile(): boolean

isDirectory

method
isDirectory(): boolean

isBlockDevice

method
isBlockDevice(): boolean

isCharacterDevice

method
isCharacterDevice(): boolean

isSymbolicLink

method
isSymbolicLink(): boolean

isFIFO

method
isFIFO(): boolean

isSocket

method
isSocket(): boolean

MemoryBigIntStats

class
class MemoryBigIntStats

constructor

constructor
constructor(stats: MemoryStats): MemoryBigIntStats

isFile

method
isFile(): boolean

isDirectory

method
isDirectory(): boolean

isBlockDevice

method
isBlockDevice(): boolean

isCharacterDevice

method
isCharacterDevice(): boolean

isSymbolicLink

method
isSymbolicLink(): boolean

isFIFO

method
isFIFO(): boolean

isSocket

method
isSocket(): boolean

MemoryDirent

class
class MemoryDirent

name

property
name: string

constructor

constructor
constructor(name: string, type: "file" | "directory"): MemoryDirent

isFile

method
isFile(): boolean

isDirectory

method
isDirectory(): boolean

isBlockDevice

method
isBlockDevice(): boolean

isCharacterDevice

method
isCharacterDevice(): boolean

isSymbolicLink

method
isSymbolicLink(): boolean

isFIFO

method
isFIFO(): boolean

isSocket

method
isSocket(): boolean

MemoryFileHandle

class
class MemoryFileHandle

fd

property
fd: number

constructor

constructor
constructor(fd: number, path: string, fs: MemoryFileSystem, node: MemoryNode, canRead: boolean, canWrite: boolean, append: boolean): MemoryFileHandle

appendFile

method
appendFile(data: string | Uint8Array, options?: { encoding?: BufferEncoding; }): Promise<void>

chmod

method
chmod(mode: number): Promise<void>

chown

method
chown(uid: number, gid: number): Promise<void>

close

method
close(): Promise<void>

createReadStream

method
createReadStream(options?: { encoding?: BufferEncoding; start?: number; end?: number; }): ReadStream

createWriteStream

method
createWriteStream(options?: { encoding?: BufferEncoding; start?: number; }): WriteStream

datasync

method
datasync(): Promise<void>

read

method
read(buffer: Buffer | Uint8Array, offset?: number, length?: number, position?: number | null): Promise<{ bytesRead: number; buffer: Buffer | Uint8Array; }>

readFile

method
readFile(options?: { encoding?: BufferEncoding; flag?: string; } | BufferEncoding): Promise<Buffer | string>

readLines

method
readLines(options?: { encoding?: BufferEncoding; }): any

stat

method
stat(options?: { bigint?: false; }): Promise<Stats>

stat

method
stat(options: { bigint: true; }): Promise<BigIntStats>

stat

method
stat(options?: { bigint?: boolean; }): Promise<Stats | BigIntStats>

sync

method
sync(): Promise<void>

truncate

method
truncate(len?: number): Promise<void>

utimes

method
utimes(atime: string | number | Date, mtime: string | number | Date): Promise<void>

write

method
write(bufferOrData: Buffer | Uint8Array | string, offsetOrPosition?: number | null, lengthOrEncoding?: number | BufferEncoding, position?: number | null): Promise<{ bytesWritten: number; buffer: any; }>

writeFile

method
writeFile(data: string | Uint8Array, options?: { encoding?: BufferEncoding; }): Promise<void>

[Symbol.asyncDispose]

method
[Symbol.asyncDispose](): Promise<void>

MemoryDir

class
class MemoryDir

path

property
path: string

constructor

constructor
constructor(path: string, entries: Dirent[]): MemoryDir

close

method
close(): Promise<void>

read

method
read(): Promise<Dirent | null>

[Symbol.asyncIterator]

method
[Symbol.asyncIterator](): AsyncIterableIterator<Dirent>

MemoryWatcher

class
class MemoryWatcher

constructor

constructor
constructor(path: string): MemoryWatcher

close

method
close(): Promise<void>

addListener

method
addListener(event: string | symbol, listener: (...args: any[]) => void): this

on

method
on(event: string | symbol, listener: (...args: any[]) => void): this

once

method
once(event: string | symbol, listener: (...args: any[]) => void): this

removeListener

method
removeListener(event: string | symbol, listener: (...args: any[]) => void): this

off

method
off(event: string | symbol, listener: (...args: any[]) => void): this

removeAllListeners

method
removeAllListeners(event?: string | symbol): this

setMaxListeners

method
setMaxListeners(n: number): this

getMaxListeners

method
getMaxListeners(): number

listeners

method
listeners(event: string | symbol): Function[]

rawListeners

method
rawListeners(event: string | symbol): Function[]

emit

method
emit(event: string | symbol, ...args: any[]): boolean

listenerCount

method
listenerCount(event: string | symbol): number

prependListener

method
prependListener(event: string | symbol, listener: (...args: any[]) => void): this

prependOnceListener

method
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this

eventNames

method
eventNames(): Array<string | symbol>

MemoryReadStream

class
class MemoryReadStream

constructor

constructor
constructor(content: Buffer): MemoryReadStream

_read

method
_read(size: number): void

close

method
close(): void

MemoryWriteStream

class
class MemoryWriteStream

constructor

constructor
constructor(onFinish: (content: Buffer) => void): MemoryWriteStream

_write

method
_write(chunk: Buffer, encoding: string, callback: (error?: Error) => void): void

_final

method
_final(callback: (error?: Error) => void): void

close

method
close(): void

Functions

createNodeError

function

Creates a Node.js compatible error with all required properties

createNodeError(code: string, message: string, path: string, syscall: string, errno?: number): NodeJS.ErrnoException

normalizePath

function
normalizePath(path: string): string

notifyWatchers

function
notifyWatchers(watchersMap: Map<string, Set<WatchListener>>, path: string, eventType: string): void

parseFlags

function
parseFlags(flags: string): number

Types

CapabilityType

type

Provider capability types

type CapabilityType = 'file-system' | 'object-storage' | 'git-repo' | 'git-host' | 'media' | 'contacts' | 'calendar'

PullRequestState

type

Pull request state.

type PullRequestState = 'open' | 'closed' | 'merged'

IssueState

type

Issue state.

type IssueState = 'open' | 'closed'

WatchOptions

type
type WatchOptions = {
  encoding?: BufferEncoding;
  persistent?: boolean;
  recursive?: boolean;
}

WatchListener

type
type WatchListener = (eventType: string, filename: string) => void

ReadStreamOptions

type
type ReadStreamOptions = {
  encoding?: BufferEncoding;
  start?: number;
  end?: number;
}

WriteStreamOptions

type
type WriteStreamOptions = {
  encoding?: BufferEncoding;
  flags?: string;
  mode?: number;
}

Interfaces

ReadStream

interface
interface ReadStream

close

method
close(): void

WriteStream

interface
interface WriteStream

close

method
close(): void

FSWatcher

interface
interface FSWatcher

close

method
close(): Promise<void>

FSConstants

interface
interface FSConstants

F_OK

property

File is visible to the calling process

F_OK: 0

R_OK

property

File can be read by the calling process

R_OK: 4

W_OK

property

File can be written by the calling process

W_OK: 2

X_OK

property

File can be executed by the calling process

X_OK: 1

COPYFILE_EXCL

property

Flag for copyFile: fail if dest exists

COPYFILE_EXCL: 1

O_RDONLY

property

Open for reading only

O_RDONLY: 0

O_WRONLY

property

Open for writing only

O_WRONLY: 1

O_RDWR

property

Open for reading and writing

O_RDWR: 2

O_CREAT

property

Create file if it does not exist

O_CREAT: 64

O_EXCL

property

Fail if O_CREAT and file exists

O_EXCL: 128

O_TRUNC

property

Truncate file to zero length

O_TRUNC: 512

O_APPEND

property

Append to end of file

O_APPEND: 1024

IFileHandle

interface
interface IFileHandle

fd

property

The numeric file descriptor

fd: number

appendFile

method
appendFile(data: string | Uint8Array, options?: { encoding?: BufferEncoding; }): Promise<void>

chmod

method
chmod(mode: number): Promise<void>

chown

method
chown(uid: number, gid: number): Promise<void>

close

method
close(): Promise<void>

createReadStream

method
createReadStream(options?: { encoding?: BufferEncoding; start?: number; end?: number; }): ReadStream

createWriteStream

method
createWriteStream(options?: { encoding?: BufferEncoding; start?: number; }): WriteStream

datasync

method
datasync(): Promise<void>

read

method
read(buffer: Buffer | Uint8Array, offset?: number, length?: number, position?: number | null): Promise<{ bytesRead: number; buffer: Buffer | Uint8Array; }>

readFile

method
readFile(options?: { encoding?: BufferEncoding; flag?: string; } | BufferEncoding): Promise<Buffer | string>

readLines

method
readLines(options?: { encoding?: BufferEncoding; }): any

stat

method
stat(options?: { bigint?: false; }): Promise<Stats>

stat

method
stat(options: { bigint: true; }): Promise<BigIntStats>

sync

method
sync(): Promise<void>

truncate

method
truncate(len?: number): Promise<void>

utimes

method
utimes(atime: string | number | Date, mtime: string | number | Date): Promise<void>

write

method
write(buffer: Buffer | Uint8Array, offset?: number, length?: number, position?: number | null): Promise<{ bytesWritten: number; buffer: Buffer | Uint8Array; }>

write

method
write(data: string, position?: number | null, encoding?: BufferEncoding): Promise<{ bytesWritten: number; buffer: string; }>

writeFile

method
writeFile(data: string | Uint8Array, options?: { encoding?: BufferEncoding; }): Promise<void>

[Symbol.asyncDispose]

method
[Symbol.asyncDispose](): Promise<void>

IDir

interface
interface IDir

path

property
path: string

close

method
close(): Promise<void>

read

method
read(): Promise<Dirent | null>

[Symbol.asyncIterator]

method
[Symbol.asyncIterator](): AsyncIterableIterator<Dirent>

StatFs

interface
interface StatFs

bsize

property

Optimal transfer block size

bsize: number

blocks

property

Total data blocks in filesystem

blocks: number

bfree

property

Free blocks in filesystem

bfree: number

bavail

property

Available blocks for unprivileged users

bavail: number

files

property

Total file nodes in filesystem

files: number

ffree

property

Free file nodes in filesystem

ffree: number

type

property

Filesystem type

type: number

BigIntStatFs

interface
interface BigIntStatFs

bsize

property
bsize: bigint

blocks

property
blocks: bigint

bfree

property
bfree: bigint

bavail

property
bavail: bigint

files

property
files: bigint

ffree

property
ffree: bigint

type

property
type: bigint

IFileSystem

interface
interface IFileSystem

promises

property
promises: this

constants

property
constants: FSConstants

readFile

method
readFile(path: string, options?: { encoding?: BufferEncoding; flag?: string; } | BufferEncoding): Promise<Buffer | string>

writeFile

method
writeFile(path: string, data: Buffer | string | Uint8Array, options?: { encoding?: BufferEncoding; mode?: number; flag?: string; }): Promise<void>

appendFile

method
appendFile(path: string, data: Buffer | string | Uint8Array, options?: { encoding?: BufferEncoding; mode?: number; flag?: string; }): Promise<void>

copyFile

method
copyFile(src: string, dest: string, mode?: number): Promise<void>

mkdir

method
mkdir(path: string, options?: { recursive?: boolean; mode?: number; }): Promise<string | undefined>

readdir

method
readdir(path: string, options?: { encoding?: BufferEncoding; withFileTypes?: false; recursive?: boolean; }): Promise<string[]>

readdir

method
readdir(path: string, options: { encoding?: BufferEncoding; withFileTypes: true; recursive?: boolean; }): Promise<Dirent[]>

rmdir

method
rmdir(path: string, options?: { maxRetries?: number; recursive?: boolean; retryDelay?: number; }): Promise<void>

stat

method
stat(path: string, options?: { bigint?: false; }): Promise<Stats>

stat

method
stat(path: string, options: { bigint: true; }): Promise<BigIntStats>

lstat

method
lstat(path: string, options?: { bigint?: false; }): Promise<Stats>

lstat

method
lstat(path: string, options: { bigint: true; }): Promise<BigIntStats>

access

method
access(path: string, mode?: number): Promise<void>

rename

method
rename(oldPath: string, newPath: string): Promise<void>

unlink

method
unlink(path: string): Promise<void>

truncate

method
truncate(path: string, len?: number): Promise<void>

utimes

method
utimes(path: string, atime: string | number | Date, mtime: string | number | Date): Promise<void>

chmod

method
chmod(path: string, mode: string | number): Promise<void>

chown

method
chown(path: string, uid: number, gid: number): Promise<void>

readlink

method
readlink(path: string, options?: { encoding?: BufferEncoding; }): Promise<string>

symlink

method
symlink(target: string, path: string, type?: "dir" | "file" | "junction"): Promise<void>

link

method
link(existingPath: string, newPath: string): Promise<void>

createReadStream

method
createReadStream(path: string, options?: { encoding?: BufferEncoding; start?: number; end?: number; }): ReadStream

createWriteStream

method
createWriteStream(path: string, options?: { encoding?: BufferEncoding; flags?: string; mode?: number; }): WriteStream

watch

method
watch(path: string, options?: { encoding?: BufferEncoding; persistent?: boolean; recursive?: boolean; }): FSWatcher

rm

method
rm(path: string, options?: { force?: boolean; maxRetries?: number; recursive?: boolean; retryDelay?: number; }): Promise<void>

open

method
open(path: string, flags?: string | number, mode?: number): Promise<IFileHandle>

opendir

method
opendir(path: string, options?: { encoding?: BufferEncoding; bufferSize?: number; recursive?: boolean; }): Promise<IDir>

realpath

method
realpath(path: string, options?: { encoding?: BufferEncoding; }): Promise<string>

cp

method
cp(src: string, dest: string, options?: { dereference?: boolean; errorOnExist?: boolean; filter?: (src: string, dest: string) => boolean | Promise<boolean>; force?: boolean; mode?: number; preserveTimestamps?: boolean; recursive?: boolean; verbatimSymlinks?: boolean; }): Promise<void>

mkdtemp

method
mkdtemp(prefix: string, options?: { encoding?: BufferEncoding; }): Promise<string>

statfs

method
statfs(path: string, options?: { bigint?: false; }): Promise<StatFs>

statfs

method
statfs(path: string, options: { bigint: true; }): Promise<BigIntStatFs>

lutimes

method
lutimes(path: string, atime: string | number | Date, mtime: string | number | Date): Promise<void>

lchown

method
lchown(path: string, uid: number, gid: number): Promise<void>

lchmod

method
lchmod(path: string, mode: string | number): Promise<void>

exists

method
exists(path: string): Promise<boolean>

isImplemented

method
isImplemented(method: string): boolean

init

method
init(options?: { encoding?: string; }): Promise<void>

Stats

interface

A `fs.Stats` object provides information about a file. Objects returned from {@link stat}, {@link lstat}, {@link fstat}, and their synchronous counterparts are of this type. If `bigint` in the `options` passed to those methods is true, the numeric values will be `bigint` instead of `number`, and the object will contain additional nanosecond-precision properties suffixed with `Ns`. `Stat` objects are not to be created directly using the `new` keyword. ```console Stats { dev: 2114, ino: 48064969, mode: 33188, nlink: 1, uid: 85, gid: 100, rdev: 0, size: 527, blksize: 4096, blocks: 8, atimeMs: 1318289051000.1, mtimeMs: 1318289051000.1, ctimeMs: 1318289051000.1, birthtimeMs: 1318289051000.1, atime: Mon, 10 Oct 2011 23:24:11 GMT, mtime: Mon, 10 Oct 2011 23:24:11 GMT, ctime: Mon, 10 Oct 2011 23:24:11 GMT, birthtime: Mon, 10 Oct 2011 23:24:11 GMT } ``` `bigint` version: ```console BigIntStats { dev: 2114n, ino: 48064969n, mode: 33188n, nlink: 1n, uid: 85n, gid: 100n, rdev: 0n, size: 527n, blksize: 4096n, blocks: 8n, atimeMs: 1318289051000n, mtimeMs: 1318289051000n, ctimeMs: 1318289051000n, birthtimeMs: 1318289051000n, atimeNs: 1318289051000000000n, mtimeNs: 1318289051000000000n, ctimeNs: 1318289051000000000n, birthtimeNs: 1318289051000000000n, atime: Mon, 10 Oct 2011 23:24:11 GMT, mtime: Mon, 10 Oct 2011 23:24:11 GMT, ctime: Mon, 10 Oct 2011 23:24:11 GMT, birthtime: Mon, 10 Oct 2011 23:24:11 GMT } ```

interface Stats

BigIntStats

interface
interface BigIntStats

atimeNs

property
atimeNs: bigint

mtimeNs

property
mtimeNs: bigint

ctimeNs

property
ctimeNs: bigint

birthtimeNs

property
birthtimeNs: bigint

IProvider

interface

Base interface for all AnyMux providers. A provider exposes one or more capabilities (file-system, object-storage, git-repo, git-host).

interface IProvider

id

property

Unique identifier for this provider instance

id: string

name

property

Human-readable display name

name: string

capabilities

property

List of capabilities this provider supports

capabilities: readonly CapabilityType[]

getCapability

method

Get a capability by type. Returns undefined if the capability is not supported.

<T>(type: CapabilityType): T | undefined

hasCapability

method

Check if this provider supports a given capability.

hasCapability(type: CapabilityType): boolean

initialize

method

Initialize the provider (e.g., authenticate, establish connections).

initialize(): Promise<void>

dispose

method

Dispose of the provider and release resources.

dispose(): Promise<void>

ObjectMetadata

interface

Metadata associated with a stored object.

interface ObjectMetadata

size

property

Size in bytes

size: number

lastModified

property

Last modified date

lastModified: Date

contentType

property

Content type (MIME)

contentType: string

etag

property

ETag for conditional operations

etag: string

metadata

property

Custom metadata key-value pairs

metadata: Record<string, string>

ListObjectsOptions

interface

Options for listing objects.

interface ListObjectsOptions

prefix

property

Filter by key prefix

prefix: string

delimiter

property

Delimiter for virtual directory grouping

delimiter: string

maxKeys

property

Maximum number of results

maxKeys: number

continuationToken

property

Continuation token for pagination

continuationToken: string

ListObjectsResult

interface

Result of a list objects operation.

interface ListObjectsResult

objects

property

Object keys and metadata

objects: { key: string; metadata: ObjectMetadata; }[]

commonPrefixes

property

Common prefixes (virtual directories) when delimiter is used

commonPrefixes: string[]

isTruncated

property

Whether more results are available

isTruncated: boolean

nextContinuationToken

property

Token to fetch next page

nextContinuationToken: string

PutObjectOptions

interface

Options for put operations.

interface PutObjectOptions

contentType

property

Content type (MIME)

contentType: string

metadata

property

Custom metadata

metadata: Record<string, string>

cacheControl

property

Cache-Control header

cacheControl: string

PresignedUrlOptions

interface

Options for generating presigned URLs.

interface PresignedUrlOptions

expiresIn

property

Expiration time in seconds (default: 3600)

expiresIn: number

method

property

HTTP method for the presigned URL

method: "GET" | "PUT"

BucketInfo

interface

Bucket information.

interface BucketInfo

name

property
name: string

creationDate

property
creationDate: Date

IObjectStorage

interface

Universal object storage interface. Abstracts S3-compatible APIs, GCS, Azure Blob Storage, etc.

interface IObjectStorage

listBuckets

method
listBuckets(): Promise<BucketInfo[]>

createBucket

method
createBucket(name: string): Promise<void>

deleteBucket

method
deleteBucket(name: string): Promise<void>

bucketExists

method
bucketExists(name: string): Promise<boolean>

getObject

method
getObject(bucket: string, key: string): Promise<Buffer>

putObject

method
putObject(bucket: string, key: string, data: Buffer | Uint8Array | string, options?: PutObjectOptions): Promise<void>

deleteObject

method
deleteObject(bucket: string, key: string): Promise<void>

headObject

method
headObject(bucket: string, key: string): Promise<ObjectMetadata>

copyObject

method
copyObject(sourceBucket: string, sourceKey: string, destBucket: string, destKey: string): Promise<void>

listObjects

method
listObjects(bucket: string, options?: ListObjectsOptions): Promise<ListObjectsResult>

getPresignedUrl

method
getPresignedUrl(bucket: string, key: string, options?: PresignedUrlOptions): Promise<string>

objectExists

method
objectExists(bucket: string, key: string): Promise<boolean>

GitCommit

interface

Git commit information.

interface GitCommit

sha

property
sha: string

message

property
message: string

author

property
author: { name: string; email: string; date: Date; }

committer

property
committer: { name: string; email: string; date: Date; }

parents

property
parents: string[]

GitBranch

interface

Git branch information.

interface GitBranch

name

property
name: string

sha

property
sha: string

isDefault

property
isDefault: boolean

isProtected

property
isProtected: boolean

GitTag

interface

Git tag information.

interface GitTag

name

property
name: string

sha

property
sha: string

message

property
message: string

GitDiffEntry

interface

A single file diff entry.

interface GitDiffEntry

path

property
path: string

status

property
status: "added" | "modified" | "deleted" | "renamed"

additions

property
additions: number

deletions

property
deletions: number

patch

property
patch: string

previousPath

property
previousPath: string

ListCommitsOptions

interface

Options for listing commits.

interface ListCommitsOptions

ref

property

Branch or ref to list commits from

ref: string

maxCount

property

Maximum number of commits

maxCount: number

path

property

Only commits affecting this path

path: string

since

property

Commits after this date

since: Date

until

property

Commits before this date

until: Date

IGitRepo

interface

Git repository interface. Provides read/write access to Git data: branches, commits, tags, diffs.

interface IGitRepo

listBranches

method
listBranches(): Promise<GitBranch[]>

getBranch

method
getBranch(name: string): Promise<GitBranch>

createBranch

method
createBranch(name: string, sha: string): Promise<GitBranch>

deleteBranch

method
deleteBranch(name: string): Promise<void>

listCommits

method
listCommits(options?: ListCommitsOptions): Promise<GitCommit[]>

getCommit

method
getCommit(sha: string): Promise<GitCommit>

listTags

method
listTags(): Promise<GitTag[]>

createTag

method
createTag(name: string, sha: string, message?: string): Promise<GitTag>

deleteTag

method
deleteTag(name: string): Promise<void>

diff

method
diff(base: string, head: string): Promise<GitDiffEntry[]>

resolveRef

method
resolveRef(ref: string): Promise<string>

PullRequest

interface

Pull request information.

interface PullRequest

number

property
number: number

title

property
title: string

body

property
body: string

state

property
state: PullRequestState

head

property
head: { ref: string; sha: string; }

base

property
base: { ref: string; sha: string; }

author

property
author: string

createdAt

property
createdAt: Date

updatedAt

property
updatedAt: Date

mergedAt

property
mergedAt: Date

labels

property
labels: string[]

reviewers

property
reviewers: string[]

Issue

interface

Issue information.

interface Issue

number

property
number: number

title

property
title: string

body

property
body: string

state

property
state: IssueState

author

property
author: string

createdAt

property
createdAt: Date

updatedAt

property
updatedAt: Date

labels

property
labels: string[]

assignees

property
assignees: string[]

Review

interface

Review information.

interface Review

id

property
id: number

author

property
author: string

state

property
state: "approved" | "changes_requested" | "commented" | "pending"

body

property
body: string

submittedAt

property
submittedAt: Date

Release

interface

Release information.

interface Release

id

property
id: number

tagName

property
tagName: string

name

property
name: string

body

property
body: string

draft

property
draft: boolean

prerelease

property
prerelease: boolean

createdAt

property
createdAt: Date

publishedAt

property
publishedAt: Date

PipelineRun

interface

Pipeline / CI run information.

interface PipelineRun

id

property
id: number

name

property
name: string

status

property
status: "queued" | "in_progress" | "completed"

conclusion

property
conclusion: "success" | "failure" | "cancelled" | "skipped"

branch

property
branch: string

sha

property
sha: string

createdAt

property
createdAt: Date

updatedAt

property
updatedAt: Date

url

property
url: string

ListPullRequestsOptions

interface

Options for listing pull requests.

interface ListPullRequestsOptions

state

property
state: PullRequestState | "all"

head

property
head: string

base

property
base: string

sort

property
sort: "created" | "updated" | "popularity"

direction

property
direction: "asc" | "desc"

maxResults

property
maxResults: number

ListIssuesOptions

interface

Options for listing issues.

interface ListIssuesOptions

state

property
state: IssueState | "all"

labels

property
labels: string[]

assignee

property
assignee: string

sort

property
sort: "created" | "updated" | "comments"

direction

property
direction: "asc" | "desc"

maxResults

property
maxResults: number

CreatePullRequestOptions

interface

Options for creating a pull request.

interface CreatePullRequestOptions

title

property
title: string

body

property
body: string

head

property
head: string

base

property
base: string

draft

property
draft: boolean

labels

property
labels: string[]

reviewers

property
reviewers: string[]

CreateIssueOptions

interface

Options for creating an issue.

interface CreateIssueOptions

title

property
title: string

body

property
body: string

labels

property
labels: string[]

assignees

property
assignees: string[]

IGitHost

interface

Git hosting platform interface. Abstracts GitHub, GitLab, Bitbucket, etc. for PRs, issues, reviews, CI, releases.

interface IGitHost

listPullRequests

method
listPullRequests(options?: ListPullRequestsOptions): Promise<PullRequest[]>

getPullRequest

method
getPullRequest(number: number): Promise<PullRequest>

createPullRequest

method
createPullRequest(options: CreatePullRequestOptions): Promise<PullRequest>

updatePullRequest

method
updatePullRequest(number: number, updates: Partial<Pick<PullRequest, "title" | "body" | "state" | "labels">>): Promise<PullRequest>

mergePullRequest

method
mergePullRequest(number: number, options?: { method?: "merge" | "squash" | "rebase"; commitMessage?: string; }): Promise<void>

listIssues

method
listIssues(options?: ListIssuesOptions): Promise<Issue[]>

getIssue

method
getIssue(number: number): Promise<Issue>

createIssue

method
createIssue(options: CreateIssueOptions): Promise<Issue>

updateIssue

method
updateIssue(number: number, updates: Partial<Pick<Issue, "title" | "body" | "state" | "labels" | "assignees">>): Promise<Issue>

listReviews

method
listReviews(pullRequestNumber: number): Promise<Review[]>

createReview

method
createReview(pullRequestNumber: number, review: { body: string; event: "approve" | "request_changes" | "comment"; }): Promise<Review>

listReleases

method
listReleases(): Promise<Release[]>

createRelease

method
createRelease(options: { tagName: string; name: string; body: string; draft?: boolean; prerelease?: boolean; }): Promise<Release>

listPipelineRuns

method
listPipelineRuns(options?: { branch?: string; status?: string; }): Promise<PipelineRun[]>

getPipelineRun

method
getPipelineRun(id: number): Promise<PipelineRun>

MemoryNode

interface
interface MemoryNode

type

property
type: "file" | "directory"

name

property
name: string

children

property
children: Map<string, MemoryNode>

content

property
content: Buffer<ArrayBufferLike>

stats

property
stats: MemoryStats

parent

property
parent: MemoryNode

linkTarget

property
linkTarget: string

isSymlink

property
isSymlink: boolean

Watcher

interface
interface Watcher

close

method
close(): void

Constants

NodeErrors

const

Factory functions for common Node.js filesystem errors

const NodeErrors: { ENOENT: (path: string, syscall: string) => NodeJS.ErrnoException; EACCES: (path: string, syscall: string) => NodeJS.ErrnoException; EEXIST: (path: string, syscall: string) => NodeJS.ErrnoException; ENOTDIR: (path: string, syscall: string) => NodeJS.ErrnoException; EISDIR: (path: string, syscall: string) => NodeJS.ErrnoException; ENOTEMPTY: (path: string, syscall: string) => NodeJS.ErrnoException; ENOSYS: (syscall: string) => NodeJS.ErrnoException; EINVAL: (path: string, syscall: string) => NodeJS.ErrnoException; EBADF: (syscall: string) => NodeJS.ErrnoException; EPERM: (path: string, syscall: string) => NodeJS.ErrnoException; ELOOP: (path: string, syscall: string) => NodeJS.ErrnoException; EXDEV: (path: string, syscall: string) => NodeJS.ErrnoException; }