Minima.js API / @minimajs/disk / adapters / FsDriver
Class: FsDriver
Filesystem storage driver for @minimajs/disk
Implements
Constructors
Constructor
new FsDriver(options): FsDriver;Parameters
options
Returns
FsDriver
Properties
name
readonly name: "fs" = "fs";Driver name (e.g., 'fs', 's3', 'azure')
Implementation of
Accessors
[toStringTag]
Get Signature
get toStringTag: string;Returns
string
capabilities
Get Signature
get capabilities(): DriverCapabilities;Optional capability declarations — see DriverCapabilities
Returns
Optional capability declarations — see DriverCapabilities
Implementation of
Methods
[custom]()
custom: {
[toStringTag]: string;
name: string;
publicUrl: string | undefined;
root: string;
sidecarMetadata: boolean;
};Returns
{
[toStringTag]: string;
name: string;
publicUrl: string | undefined;
root: string;
sidecarMetadata: boolean;
}[toStringTag]
[toStringTag]: string = "FsDriver";name
name: string;publicUrl
publicUrl: string | undefined;root
root: string;sidecarMetadata
sidecarMetadata: boolean;copy()
copy(from, to): Promise<void>;Copy a file to a new location
Parameters
from
string
Source absolute URL/URI
to
string
Destination absolute URL/URI
Returns
Promise<void>
Implementation of
delete()
delete(href): Promise<void>;Delete file by href
Parameters
href
string
Absolute URL/URI with protocol
Returns
Promise<void>
Implementation of
exists()
exists(href): Promise<boolean>;Check if file exists
Parameters
href
string
Absolute URL/URI with protocol
Returns
Promise<boolean>
Implementation of
get()
get(href): Promise<
| [ReadableStream<Uint8Array<ArrayBufferLike>>, FileMetadata]
| null>;Retrieve file as a ReadableStream with metadata
Parameters
href
string
Absolute URL/URI with protocol
Returns
Promise< | [ReadableStream<Uint8Array<ArrayBufferLike>>, FileMetadata] | null>
Tuple of [stream, metadata] or null if not found
Implementation of
list()
list(prefix, listOptions?): AsyncIterable<FileMetadata>;List files under a prefix href.
Parameters
prefix
string
Absolute href prefix ending with /, or "" to list everything.
listOptions?
Pagination options
Returns
AsyncIterable<FileMetadata>
Implementation of
metadata()
metadata(href): Promise<
| FileMetadata
| null>;Get file metadata without content
Parameters
href
string
Absolute URL/URI with protocol
Returns
Promise< | FileMetadata | null>
Implementation of
move()
move(from, to): Promise<void>;Move a file to a new location
Parameters
from
string
Source absolute URL/URI
to
string
Destination absolute URL/URI
Returns
Promise<void>
Implementation of
put()
put(
href,
stream,
putOptions): Promise<FileMetadata>;Store data from a ReadableStream
Parameters
href
string
Absolute URL/URI with protocol
stream
ReadableStream<Uint8Array<ArrayBufferLike>>
ReadableStream of data to store
putOptions
Optional metadata and content type
Returns
Promise<FileMetadata>
FileMetadata about the stored file
Implementation of
storageInfo()
storageInfo(): Promise<StorageInfo>;Returns
Promise<StorageInfo>
url()
url(href, _urlOptions?): Promise<string>;Generate a URL for the file
Parameters
href
string
Absolute URL/URI with protocol
_urlOptions?
URL options (expiration, download disposition)
Returns
Promise<string>
Implementation of
watch()
watch(pattern, options?): Promise<FSWatcher>;Watch files for changes using chokidar
Parameters
pattern
string
options?
Returns
Promise<FSWatcher>