File System API reference
Exports of @anymux/file-system. Back to the module
Classes
Dirent
classA 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
methodReturns `true` if the `fs.Dirent` object describes a regular file.
isFile(): boolean
isDirectory
methodReturns `true` if the `fs.Dirent` object describes a file system directory.
isDirectory(): boolean
isBlockDevice
methodReturns `true` if the `fs.Dirent` object describes a block device.
isBlockDevice(): boolean
isCharacterDevice
methodReturns `true` if the `fs.Dirent` object describes a character device.
isCharacterDevice(): boolean
isSymbolicLink
methodReturns `true` if the `fs.Dirent` object describes a symbolic link.
isSymbolicLink(): boolean
isFIFO
methodReturns `true` if the `fs.Dirent` object describes a first-in-first-out (FIFO) pipe.
isFIFO(): boolean
isSocket
methodReturns `true` if the `fs.Dirent` object describes a socket.
isSocket(): boolean
name
propertyThe 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
propertyThe path to the parent directory of the file this `fs.Dirent` object refers to.
parentPath: string
path
propertyAlias for `dirent.parentPath`.
path: string
MemoryFileSystem
classclass MemoryFileSystem
promises
propertypromises: this
constants
propertyconstants: FSConstants
constructor
constructorconstructor(): MemoryFileSystem
init
methodinit(): Promise<void>
readFile
methodreadFile(path: string, options?: { encoding?: BufferEncoding; flag?: string; } | BufferEncoding): Promise<Buffer | string>writeFile
methodwriteFile(path: string, data: Buffer | string | Uint8Array, options?: { encoding?: BufferEncoding; mode?: number; flag?: string; }): Promise<void>copyFile
methodcopyFile(src: string, dest: string, mode?: number): Promise<void>
appendFile
methodappendFile(path: string, data: Buffer | string | Uint8Array, options?: { encoding?: BufferEncoding; mode?: number; flag?: string; }): Promise<void>mkdir
methodmkdir(path: string, options?: { recursive?: boolean; mode?: number; }): Promise<string | undefined>readdir
methodreaddir(path: string, options?: { encoding?: BufferEncoding; withFileTypes?: false; recursive?: boolean; }): Promise<string[]>readdir
methodreaddir(path: string, options: { encoding?: BufferEncoding; withFileTypes: true; recursive?: boolean; }): Promise<Dirent[]>readdir
methodreaddir(path: string, options?: { encoding?: BufferEncoding; withFileTypes?: boolean; recursive?: boolean; }): Promise<string[] | Dirent[]>rmdir
methodrmdir(path: string, options?: { maxRetries?: number; recursive?: boolean; retryDelay?: number; }): Promise<void>stat
methodstat(path: string, options?: { bigint?: false; }): Promise<Stats>stat
methodstat(path: string, options: { bigint: true; }): Promise<BigIntStats>stat
methodstat(path: string, options?: { bigint?: boolean; }): Promise<Stats | BigIntStats>lstat
methodlstat(path: string, options?: { bigint?: false; }): Promise<Stats>lstat
methodlstat(path: string, options: { bigint: true; }): Promise<BigIntStats>lstat
methodlstat(path: string, options?: { bigint?: boolean; }): Promise<Stats | BigIntStats>rename
methodrename(oldPath: string, newPath: string): Promise<void>
unlink
methodunlink(path: string): Promise<void>
exists
methodexists(path: string): Promise<boolean>
access
methodaccess(path: string, mode?: number): Promise<void>
chmod
methodchmod(path: string, mode: string | number): Promise<void>
chown
methodchown(path: string, uid: number, gid: number): Promise<void>
readlink
methodreadlink(path: string, options?: { encoding?: BufferEncoding; }): Promise<string>symlink
methodsymlink(target: string, path: string, type?: "dir" | "file" | "junction"): Promise<void>
link
methodlink(existingPath: string, newPath: string): Promise<void>
truncate
methodtruncate(path: string, len?: number): Promise<void>
utimes
methodutimes(path: string, atime: string | number | Date, mtime: string | number | Date): Promise<void>
rm
methodrm(path: string, options?: { force?: boolean; maxRetries?: number; recursive?: boolean; retryDelay?: number; }): Promise<void>open
methodopen(path: string, flags?: string | number, mode?: number): Promise<IFileHandle>
opendir
methodopendir(path: string, options?: { encoding?: BufferEncoding; bufferSize?: number; recursive?: boolean; }): Promise<IDir>realpath
methodrealpath(path: string, options?: { encoding?: BufferEncoding; }): Promise<string>cp
methodcp(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
methodmkdtemp(prefix: string, options?: { encoding?: BufferEncoding; }): Promise<string>statfs
methodstatfs(path: string, options?: { bigint?: false; }): Promise<StatFs>statfs
methodstatfs(path: string, options: { bigint: true; }): Promise<BigIntStatFs>statfs
methodstatfs(path: string, options?: { bigint?: boolean; }): Promise<StatFs | BigIntStatFs>lutimes
methodlutimes(path: string, atime: string | number | Date, mtime: string | number | Date): Promise<void>
lchown
methodlchown(path: string, uid: number, gid: number): Promise<void>
lchmod
methodlchmod(path: string, mode: string | number): Promise<void>
createReadStream
methodcreateReadStream(path: string, options?: ReadStreamOptions): ReadStream
createWriteStream
methodcreateWriteStream(path: string, options?: WriteStreamOptions): WriteStream
watch
methodwatch(path: string, options?: { encoding?: BufferEncoding; persistent?: boolean; recursive?: boolean; }): FSWatcherisImplemented
methodisImplemented(method: string): boolean
_getNode
method_getNode(path: string): MemoryNode | undefined
MemoryStats
classclass MemoryStats
dev
propertydev: number
ino
propertyino: number
mode
propertymode: number
nlink
propertynlink: number
uid
propertyuid: number
gid
propertygid: number
rdev
propertyrdev: number
size
propertysize: number
blksize
propertyblksize: number
blocks
propertyblocks: number
atime
propertyatime: Date
mtime
propertymtime: Date
ctime
propertyctime: Date
birthtime
propertybirthtime: Date
isFile
methodisFile(): boolean
isDirectory
methodisDirectory(): boolean
isBlockDevice
methodisBlockDevice(): boolean
isCharacterDevice
methodisCharacterDevice(): boolean
isSymbolicLink
methodisSymbolicLink(): boolean
isFIFO
methodisFIFO(): boolean
isSocket
methodisSocket(): boolean
MemoryBigIntStats
classclass MemoryBigIntStats
constructor
constructorconstructor(stats: MemoryStats): MemoryBigIntStats
isFile
methodisFile(): boolean
isDirectory
methodisDirectory(): boolean
isBlockDevice
methodisBlockDevice(): boolean
isCharacterDevice
methodisCharacterDevice(): boolean
isSymbolicLink
methodisSymbolicLink(): boolean
isFIFO
methodisFIFO(): boolean
isSocket
methodisSocket(): boolean
MemoryDirent
classclass MemoryDirent
name
propertyname: string
constructor
constructorconstructor(name: string, type: "file" | "directory"): MemoryDirent
isFile
methodisFile(): boolean
isDirectory
methodisDirectory(): boolean
isBlockDevice
methodisBlockDevice(): boolean
isCharacterDevice
methodisCharacterDevice(): boolean
isSymbolicLink
methodisSymbolicLink(): boolean
isFIFO
methodisFIFO(): boolean
isSocket
methodisSocket(): boolean
MemoryFileHandle
classclass MemoryFileHandle
fd
propertyfd: number
constructor
constructorconstructor(fd: number, path: string, fs: MemoryFileSystem, node: MemoryNode, canRead: boolean, canWrite: boolean, append: boolean): MemoryFileHandle
appendFile
methodappendFile(data: string | Uint8Array, options?: { encoding?: BufferEncoding; }): Promise<void>chmod
methodchmod(mode: number): Promise<void>
chown
methodchown(uid: number, gid: number): Promise<void>
close
methodclose(): Promise<void>
createReadStream
methodcreateReadStream(options?: { encoding?: BufferEncoding; start?: number; end?: number; }): ReadStreamcreateWriteStream
methodcreateWriteStream(options?: { encoding?: BufferEncoding; start?: number; }): WriteStreamdatasync
methoddatasync(): Promise<void>
read
methodread(buffer: Buffer | Uint8Array, offset?: number, length?: number, position?: number | null): Promise<{ bytesRead: number; buffer: Buffer | Uint8Array; }>readFile
methodreadFile(options?: { encoding?: BufferEncoding; flag?: string; } | BufferEncoding): Promise<Buffer | string>readLines
methodreadLines(options?: { encoding?: BufferEncoding; }): anystat
methodstat(options?: { bigint?: false; }): Promise<Stats>stat
methodstat(options: { bigint: true; }): Promise<BigIntStats>stat
methodstat(options?: { bigint?: boolean; }): Promise<Stats | BigIntStats>sync
methodsync(): Promise<void>
truncate
methodtruncate(len?: number): Promise<void>
utimes
methodutimes(atime: string | number | Date, mtime: string | number | Date): Promise<void>
write
methodwrite(bufferOrData: Buffer | Uint8Array | string, offsetOrPosition?: number | null, lengthOrEncoding?: number | BufferEncoding, position?: number | null): Promise<{ bytesWritten: number; buffer: any; }>writeFile
methodwriteFile(data: string | Uint8Array, options?: { encoding?: BufferEncoding; }): Promise<void>[Symbol.asyncDispose]
method[Symbol.asyncDispose](): Promise<void>
MemoryDir
classclass MemoryDir
path
propertypath: string
constructor
constructorconstructor(path: string, entries: Dirent[]): MemoryDir
close
methodclose(): Promise<void>
read
methodread(): Promise<Dirent | null>
[Symbol.asyncIterator]
method[Symbol.asyncIterator](): AsyncIterableIterator<Dirent>
MemoryWatcher
classclass MemoryWatcher
constructor
constructorconstructor(path: string): MemoryWatcher
close
methodclose(): Promise<void>
addListener
methodaddListener(event: string | symbol, listener: (...args: any[]) => void): this
on
methodon(event: string | symbol, listener: (...args: any[]) => void): this
once
methodonce(event: string | symbol, listener: (...args: any[]) => void): this
removeListener
methodremoveListener(event: string | symbol, listener: (...args: any[]) => void): this
off
methodoff(event: string | symbol, listener: (...args: any[]) => void): this
removeAllListeners
methodremoveAllListeners(event?: string | symbol): this
setMaxListeners
methodsetMaxListeners(n: number): this
getMaxListeners
methodgetMaxListeners(): number
listeners
methodlisteners(event: string | symbol): Function[]
rawListeners
methodrawListeners(event: string | symbol): Function[]
emit
methodemit(event: string | symbol, ...args: any[]): boolean
listenerCount
methodlistenerCount(event: string | symbol): number
prependListener
methodprependListener(event: string | symbol, listener: (...args: any[]) => void): this
prependOnceListener
methodprependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this
eventNames
methodeventNames(): Array<string | symbol>
MemoryReadStream
classclass MemoryReadStream
constructor
constructorconstructor(content: Buffer): MemoryReadStream
_read
method_read(size: number): void
close
methodclose(): void
MemoryWriteStream
classclass MemoryWriteStream
constructor
constructorconstructor(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
methodclose(): void
Functions
createNodeError
functionCreates a Node.js compatible error with all required properties
createNodeError(code: string, message: string, path: string, syscall: string, errno?: number): NodeJS.ErrnoException
normalizePath
functionnormalizePath(path: string): string
notifyWatchers
functionnotifyWatchers(watchersMap: Map<string, Set<WatchListener>>, path: string, eventType: string): void
parseFlags
functionparseFlags(flags: string): number
Types
CapabilityType
typeProvider capability types
type CapabilityType = 'file-system' | 'object-storage' | 'git-repo' | 'git-host' | 'media' | 'contacts' | 'calendar'
PullRequestState
typePull request state.
type PullRequestState = 'open' | 'closed' | 'merged'
IssueState
typeIssue state.
type IssueState = 'open' | 'closed'
WatchOptions
typetype WatchOptions = {
encoding?: BufferEncoding;
persistent?: boolean;
recursive?: boolean;
}WatchListener
typetype WatchListener = (eventType: string, filename: string) => void
ReadStreamOptions
typetype ReadStreamOptions = {
encoding?: BufferEncoding;
start?: number;
end?: number;
}WriteStreamOptions
typetype WriteStreamOptions = {
encoding?: BufferEncoding;
flags?: string;
mode?: number;
}Interfaces
ReadStream
interfaceinterface ReadStream
close
methodclose(): void
WriteStream
interfaceinterface WriteStream
close
methodclose(): void
FSWatcher
interfaceinterface FSWatcher
close
methodclose(): Promise<void>
FSConstants
interfaceinterface FSConstants
F_OK
propertyFile is visible to the calling process
F_OK: 0
R_OK
propertyFile can be read by the calling process
R_OK: 4
W_OK
propertyFile can be written by the calling process
W_OK: 2
X_OK
propertyFile can be executed by the calling process
X_OK: 1
COPYFILE_EXCL
propertyFlag for copyFile: fail if dest exists
COPYFILE_EXCL: 1
O_RDONLY
propertyOpen for reading only
O_RDONLY: 0
O_WRONLY
propertyOpen for writing only
O_WRONLY: 1
O_RDWR
propertyOpen for reading and writing
O_RDWR: 2
O_CREAT
propertyCreate file if it does not exist
O_CREAT: 64
O_EXCL
propertyFail if O_CREAT and file exists
O_EXCL: 128
O_TRUNC
propertyTruncate file to zero length
O_TRUNC: 512
O_APPEND
propertyAppend to end of file
O_APPEND: 1024
IFileHandle
interfaceinterface IFileHandle
fd
propertyThe numeric file descriptor
fd: number
appendFile
methodappendFile(data: string | Uint8Array, options?: { encoding?: BufferEncoding; }): Promise<void>chmod
methodchmod(mode: number): Promise<void>
chown
methodchown(uid: number, gid: number): Promise<void>
close
methodclose(): Promise<void>
createReadStream
methodcreateReadStream(options?: { encoding?: BufferEncoding; start?: number; end?: number; }): ReadStreamcreateWriteStream
methodcreateWriteStream(options?: { encoding?: BufferEncoding; start?: number; }): WriteStreamdatasync
methoddatasync(): Promise<void>
read
methodread(buffer: Buffer | Uint8Array, offset?: number, length?: number, position?: number | null): Promise<{ bytesRead: number; buffer: Buffer | Uint8Array; }>readFile
methodreadFile(options?: { encoding?: BufferEncoding; flag?: string; } | BufferEncoding): Promise<Buffer | string>readLines
methodreadLines(options?: { encoding?: BufferEncoding; }): anystat
methodstat(options?: { bigint?: false; }): Promise<Stats>stat
methodstat(options: { bigint: true; }): Promise<BigIntStats>sync
methodsync(): Promise<void>
truncate
methodtruncate(len?: number): Promise<void>
utimes
methodutimes(atime: string | number | Date, mtime: string | number | Date): Promise<void>
write
methodwrite(buffer: Buffer | Uint8Array, offset?: number, length?: number, position?: number | null): Promise<{ bytesWritten: number; buffer: Buffer | Uint8Array; }>write
methodwrite(data: string, position?: number | null, encoding?: BufferEncoding): Promise<{ bytesWritten: number; buffer: string; }>writeFile
methodwriteFile(data: string | Uint8Array, options?: { encoding?: BufferEncoding; }): Promise<void>[Symbol.asyncDispose]
method[Symbol.asyncDispose](): Promise<void>
IDir
interfaceinterface IDir
path
propertypath: string
close
methodclose(): Promise<void>
read
methodread(): Promise<Dirent | null>
[Symbol.asyncIterator]
method[Symbol.asyncIterator](): AsyncIterableIterator<Dirent>
StatFs
interfaceinterface StatFs
bsize
propertyOptimal transfer block size
bsize: number
blocks
propertyTotal data blocks in filesystem
blocks: number
bfree
propertyFree blocks in filesystem
bfree: number
bavail
propertyAvailable blocks for unprivileged users
bavail: number
files
propertyTotal file nodes in filesystem
files: number
ffree
propertyFree file nodes in filesystem
ffree: number
type
propertyFilesystem type
type: number
BigIntStatFs
interfaceinterface BigIntStatFs
bsize
propertybsize: bigint
blocks
propertyblocks: bigint
bfree
propertybfree: bigint
bavail
propertybavail: bigint
files
propertyfiles: bigint
ffree
propertyffree: bigint
type
propertytype: bigint
IFileSystem
interfaceinterface IFileSystem
promises
propertypromises: this
constants
propertyconstants: FSConstants
readFile
methodreadFile(path: string, options?: { encoding?: BufferEncoding; flag?: string; } | BufferEncoding): Promise<Buffer | string>writeFile
methodwriteFile(path: string, data: Buffer | string | Uint8Array, options?: { encoding?: BufferEncoding; mode?: number; flag?: string; }): Promise<void>appendFile
methodappendFile(path: string, data: Buffer | string | Uint8Array, options?: { encoding?: BufferEncoding; mode?: number; flag?: string; }): Promise<void>copyFile
methodcopyFile(src: string, dest: string, mode?: number): Promise<void>
mkdir
methodmkdir(path: string, options?: { recursive?: boolean; mode?: number; }): Promise<string | undefined>readdir
methodreaddir(path: string, options?: { encoding?: BufferEncoding; withFileTypes?: false; recursive?: boolean; }): Promise<string[]>readdir
methodreaddir(path: string, options: { encoding?: BufferEncoding; withFileTypes: true; recursive?: boolean; }): Promise<Dirent[]>rmdir
methodrmdir(path: string, options?: { maxRetries?: number; recursive?: boolean; retryDelay?: number; }): Promise<void>stat
methodstat(path: string, options?: { bigint?: false; }): Promise<Stats>stat
methodstat(path: string, options: { bigint: true; }): Promise<BigIntStats>lstat
methodlstat(path: string, options?: { bigint?: false; }): Promise<Stats>lstat
methodlstat(path: string, options: { bigint: true; }): Promise<BigIntStats>access
methodaccess(path: string, mode?: number): Promise<void>
rename
methodrename(oldPath: string, newPath: string): Promise<void>
unlink
methodunlink(path: string): Promise<void>
truncate
methodtruncate(path: string, len?: number): Promise<void>
utimes
methodutimes(path: string, atime: string | number | Date, mtime: string | number | Date): Promise<void>
chmod
methodchmod(path: string, mode: string | number): Promise<void>
chown
methodchown(path: string, uid: number, gid: number): Promise<void>
readlink
methodreadlink(path: string, options?: { encoding?: BufferEncoding; }): Promise<string>symlink
methodsymlink(target: string, path: string, type?: "dir" | "file" | "junction"): Promise<void>
link
methodlink(existingPath: string, newPath: string): Promise<void>
createReadStream
methodcreateReadStream(path: string, options?: { encoding?: BufferEncoding; start?: number; end?: number; }): ReadStreamcreateWriteStream
methodcreateWriteStream(path: string, options?: { encoding?: BufferEncoding; flags?: string; mode?: number; }): WriteStreamwatch
methodwatch(path: string, options?: { encoding?: BufferEncoding; persistent?: boolean; recursive?: boolean; }): FSWatcherrm
methodrm(path: string, options?: { force?: boolean; maxRetries?: number; recursive?: boolean; retryDelay?: number; }): Promise<void>open
methodopen(path: string, flags?: string | number, mode?: number): Promise<IFileHandle>
opendir
methodopendir(path: string, options?: { encoding?: BufferEncoding; bufferSize?: number; recursive?: boolean; }): Promise<IDir>realpath
methodrealpath(path: string, options?: { encoding?: BufferEncoding; }): Promise<string>cp
methodcp(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
methodmkdtemp(prefix: string, options?: { encoding?: BufferEncoding; }): Promise<string>statfs
methodstatfs(path: string, options?: { bigint?: false; }): Promise<StatFs>statfs
methodstatfs(path: string, options: { bigint: true; }): Promise<BigIntStatFs>lutimes
methodlutimes(path: string, atime: string | number | Date, mtime: string | number | Date): Promise<void>
lchown
methodlchown(path: string, uid: number, gid: number): Promise<void>
lchmod
methodlchmod(path: string, mode: string | number): Promise<void>
exists
methodexists(path: string): Promise<boolean>
isImplemented
methodisImplemented(method: string): boolean
init
methodinit(options?: { encoding?: string; }): Promise<void>Stats
interfaceA `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
interfaceinterface BigIntStats
atimeNs
propertyatimeNs: bigint
mtimeNs
propertymtimeNs: bigint
ctimeNs
propertyctimeNs: bigint
birthtimeNs
propertybirthtimeNs: bigint
IProvider
interfaceBase interface for all AnyMux providers. A provider exposes one or more capabilities (file-system, object-storage, git-repo, git-host).
interface IProvider
id
propertyUnique identifier for this provider instance
id: string
name
propertyHuman-readable display name
name: string
capabilities
propertyList of capabilities this provider supports
capabilities: readonly CapabilityType[]
getCapability
methodGet a capability by type. Returns undefined if the capability is not supported.
<T>(type: CapabilityType): T | undefined
hasCapability
methodCheck if this provider supports a given capability.
hasCapability(type: CapabilityType): boolean
initialize
methodInitialize the provider (e.g., authenticate, establish connections).
initialize(): Promise<void>
dispose
methodDispose of the provider and release resources.
dispose(): Promise<void>
ObjectMetadata
interfaceMetadata associated with a stored object.
interface ObjectMetadata
size
propertySize in bytes
size: number
lastModified
propertyLast modified date
lastModified: Date
contentType
propertyContent type (MIME)
contentType: string
etag
propertyETag for conditional operations
etag: string
metadata
propertyCustom metadata key-value pairs
metadata: Record<string, string>
ListObjectsOptions
interfaceOptions for listing objects.
interface ListObjectsOptions
prefix
propertyFilter by key prefix
prefix: string
delimiter
propertyDelimiter for virtual directory grouping
delimiter: string
maxKeys
propertyMaximum number of results
maxKeys: number
continuationToken
propertyContinuation token for pagination
continuationToken: string
ListObjectsResult
interfaceResult of a list objects operation.
interface ListObjectsResult
objects
propertyObject keys and metadata
objects: { key: string; metadata: ObjectMetadata; }[]commonPrefixes
propertyCommon prefixes (virtual directories) when delimiter is used
commonPrefixes: string[]
isTruncated
propertyWhether more results are available
isTruncated: boolean
nextContinuationToken
propertyToken to fetch next page
nextContinuationToken: string
PutObjectOptions
interfaceOptions for put operations.
interface PutObjectOptions
contentType
propertyContent type (MIME)
contentType: string
metadata
propertyCustom metadata
metadata: Record<string, string>
cacheControl
propertyCache-Control header
cacheControl: string
PresignedUrlOptions
interfaceOptions for generating presigned URLs.
interface PresignedUrlOptions
expiresIn
propertyExpiration time in seconds (default: 3600)
expiresIn: number
method
propertyHTTP method for the presigned URL
method: "GET" | "PUT"
BucketInfo
interfaceBucket information.
interface BucketInfo
name
propertyname: string
creationDate
propertycreationDate: Date
IObjectStorage
interfaceUniversal object storage interface. Abstracts S3-compatible APIs, GCS, Azure Blob Storage, etc.
interface IObjectStorage
listBuckets
methodlistBuckets(): Promise<BucketInfo[]>
createBucket
methodcreateBucket(name: string): Promise<void>
deleteBucket
methoddeleteBucket(name: string): Promise<void>
bucketExists
methodbucketExists(name: string): Promise<boolean>
getObject
methodgetObject(bucket: string, key: string): Promise<Buffer>
putObject
methodputObject(bucket: string, key: string, data: Buffer | Uint8Array | string, options?: PutObjectOptions): Promise<void>
deleteObject
methoddeleteObject(bucket: string, key: string): Promise<void>
headObject
methodheadObject(bucket: string, key: string): Promise<ObjectMetadata>
copyObject
methodcopyObject(sourceBucket: string, sourceKey: string, destBucket: string, destKey: string): Promise<void>
listObjects
methodlistObjects(bucket: string, options?: ListObjectsOptions): Promise<ListObjectsResult>
getPresignedUrl
methodgetPresignedUrl(bucket: string, key: string, options?: PresignedUrlOptions): Promise<string>
objectExists
methodobjectExists(bucket: string, key: string): Promise<boolean>
GitCommit
interfaceGit commit information.
interface GitCommit
sha
propertysha: string
message
propertymessage: string
author
propertyauthor: { name: string; email: string; date: Date; }committer
propertycommitter: { name: string; email: string; date: Date; }parents
propertyparents: string[]
GitBranch
interfaceGit branch information.
interface GitBranch
name
propertyname: string
sha
propertysha: string
isDefault
propertyisDefault: boolean
isProtected
propertyisProtected: boolean
GitTag
interfaceGit tag information.
interface GitTag
name
propertyname: string
sha
propertysha: string
message
propertymessage: string
GitDiffEntry
interfaceA single file diff entry.
interface GitDiffEntry
path
propertypath: string
status
propertystatus: "added" | "modified" | "deleted" | "renamed"
additions
propertyadditions: number
deletions
propertydeletions: number
patch
propertypatch: string
previousPath
propertypreviousPath: string
ListCommitsOptions
interfaceOptions for listing commits.
interface ListCommitsOptions
ref
propertyBranch or ref to list commits from
ref: string
maxCount
propertyMaximum number of commits
maxCount: number
path
propertyOnly commits affecting this path
path: string
since
propertyCommits after this date
since: Date
until
propertyCommits before this date
until: Date
IGitRepo
interfaceGit repository interface. Provides read/write access to Git data: branches, commits, tags, diffs.
interface IGitRepo
listBranches
methodlistBranches(): Promise<GitBranch[]>
getBranch
methodgetBranch(name: string): Promise<GitBranch>
createBranch
methodcreateBranch(name: string, sha: string): Promise<GitBranch>
deleteBranch
methoddeleteBranch(name: string): Promise<void>
listCommits
methodlistCommits(options?: ListCommitsOptions): Promise<GitCommit[]>
getCommit
methodgetCommit(sha: string): Promise<GitCommit>
listTags
methodlistTags(): Promise<GitTag[]>
createTag
methodcreateTag(name: string, sha: string, message?: string): Promise<GitTag>
deleteTag
methoddeleteTag(name: string): Promise<void>
diff
methoddiff(base: string, head: string): Promise<GitDiffEntry[]>
resolveRef
methodresolveRef(ref: string): Promise<string>
PullRequest
interfacePull request information.
interface PullRequest
number
propertynumber: number
title
propertytitle: string
body
propertybody: string
state
propertystate: PullRequestState
head
propertyhead: { ref: string; sha: string; }base
propertybase: { ref: string; sha: string; }author
propertyauthor: string
createdAt
propertycreatedAt: Date
updatedAt
propertyupdatedAt: Date
mergedAt
propertymergedAt: Date
labels
propertylabels: string[]
reviewers
propertyreviewers: string[]
Issue
interfaceIssue information.
interface Issue
number
propertynumber: number
title
propertytitle: string
body
propertybody: string
state
propertystate: IssueState
author
propertyauthor: string
createdAt
propertycreatedAt: Date
updatedAt
propertyupdatedAt: Date
labels
propertylabels: string[]
assignees
propertyassignees: string[]
Review
interfaceReview information.
interface Review
id
propertyid: number
author
propertyauthor: string
state
propertystate: "approved" | "changes_requested" | "commented" | "pending"
body
propertybody: string
submittedAt
propertysubmittedAt: Date
Release
interfaceRelease information.
interface Release
id
propertyid: number
tagName
propertytagName: string
name
propertyname: string
body
propertybody: string
draft
propertydraft: boolean
prerelease
propertyprerelease: boolean
createdAt
propertycreatedAt: Date
publishedAt
propertypublishedAt: Date
PipelineRun
interfacePipeline / CI run information.
interface PipelineRun
id
propertyid: number
name
propertyname: string
status
propertystatus: "queued" | "in_progress" | "completed"
conclusion
propertyconclusion: "success" | "failure" | "cancelled" | "skipped"
branch
propertybranch: string
sha
propertysha: string
createdAt
propertycreatedAt: Date
updatedAt
propertyupdatedAt: Date
url
propertyurl: string
ListPullRequestsOptions
interfaceOptions for listing pull requests.
interface ListPullRequestsOptions
state
propertystate: PullRequestState | "all"
head
propertyhead: string
base
propertybase: string
sort
propertysort: "created" | "updated" | "popularity"
direction
propertydirection: "asc" | "desc"
maxResults
propertymaxResults: number
ListIssuesOptions
interfaceOptions for listing issues.
interface ListIssuesOptions
state
propertystate: IssueState | "all"
labels
propertylabels: string[]
assignee
propertyassignee: string
sort
propertysort: "created" | "updated" | "comments"
direction
propertydirection: "asc" | "desc"
maxResults
propertymaxResults: number
CreatePullRequestOptions
interfaceOptions for creating a pull request.
interface CreatePullRequestOptions
title
propertytitle: string
body
propertybody: string
head
propertyhead: string
base
propertybase: string
draft
propertydraft: boolean
labels
propertylabels: string[]
reviewers
propertyreviewers: string[]
CreateIssueOptions
interfaceOptions for creating an issue.
interface CreateIssueOptions
title
propertytitle: string
body
propertybody: string
labels
propertylabels: string[]
assignees
propertyassignees: string[]
IGitHost
interfaceGit hosting platform interface. Abstracts GitHub, GitLab, Bitbucket, etc. for PRs, issues, reviews, CI, releases.
interface IGitHost
listPullRequests
methodlistPullRequests(options?: ListPullRequestsOptions): Promise<PullRequest[]>
getPullRequest
methodgetPullRequest(number: number): Promise<PullRequest>
createPullRequest
methodcreatePullRequest(options: CreatePullRequestOptions): Promise<PullRequest>
updatePullRequest
methodupdatePullRequest(number: number, updates: Partial<Pick<PullRequest, "title" | "body" | "state" | "labels">>): Promise<PullRequest>
mergePullRequest
methodmergePullRequest(number: number, options?: { method?: "merge" | "squash" | "rebase"; commitMessage?: string; }): Promise<void>listIssues
methodlistIssues(options?: ListIssuesOptions): Promise<Issue[]>
getIssue
methodgetIssue(number: number): Promise<Issue>
createIssue
methodcreateIssue(options: CreateIssueOptions): Promise<Issue>
updateIssue
methodupdateIssue(number: number, updates: Partial<Pick<Issue, "title" | "body" | "state" | "labels" | "assignees">>): Promise<Issue>
listReviews
methodlistReviews(pullRequestNumber: number): Promise<Review[]>
createReview
methodcreateReview(pullRequestNumber: number, review: { body: string; event: "approve" | "request_changes" | "comment"; }): Promise<Review>listReleases
methodlistReleases(): Promise<Release[]>
createRelease
methodcreateRelease(options: { tagName: string; name: string; body: string; draft?: boolean; prerelease?: boolean; }): Promise<Release>listPipelineRuns
methodlistPipelineRuns(options?: { branch?: string; status?: string; }): Promise<PipelineRun[]>getPipelineRun
methodgetPipelineRun(id: number): Promise<PipelineRun>
MemoryNode
interfaceinterface MemoryNode
type
propertytype: "file" | "directory"
name
propertyname: string
children
propertychildren: Map<string, MemoryNode>
content
propertycontent: Buffer<ArrayBufferLike>
stats
propertystats: MemoryStats
parent
propertyparent: MemoryNode
linkTarget
propertylinkTarget: string
isSymlink
propertyisSymlink: boolean
Watcher
interfaceinterface Watcher
close
methodclose(): void
Constants
NodeErrors
constFactory 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; }