class MemoryProvider
implements StorageProvider
Since 0.1.0

In-memory storage provider backed by Map<string, Uint8Array>.

getSignedUrl returns a deterministic synthetic URL memory://<encoded-key>?expires=<epoch> — non-functional off-process.

Constructors

MemoryProvider(now?: () => number)
Parameters
optional
now: () => number

Wall-clock source (epoch ms). Injected by createProvider as runtime.now(); the runtime service is the only sanctioned clock outside packages/runtime. Defaults to () => 0 for direct construction where the synthetic signed-URL expiry is not exercised.

Methods

connect(): Promise<void>

Connect is a no-op for the memory provider.

delete(path: string): Promise<boolean>

Deletes an object from memory.

disconnect(): Promise<void>

Disconnect is a no-op for the memory provider.

exists(path: string): Promise<boolean>

Reports whether an object exists in memory.

get(path: string): Promise<Uint8Array | null>

Retrieves an object from memory; null when absent.

getSignedUrl(
path: string,
options: { expiresIn: number; }
): Promise<string>

Returns a synthetic memory:// URL with expiry query parameter.

Since 0.1.0
isHealthy(): Promise<boolean>

M70c: an in-memory store has no backend to be unreachable, so it is always reachable (M47).

isReady(): boolean

Reports readiness (memory is always ready once connected).

put(
path: string,
data: Uint8Array,
_options?: PutObjectOptions
): Promise<void>

Stores an object in memory.

Object attributes are ACCEPTED AND NOT PERSISTED: this store holds bytes only and its getSignedUrl produces a synthetic URL nothing fetches, so retaining a content type would be a field no code path reads. Documented per provider in the package README rather than silently dropped.

Usage

import { MemoryProvider } from "storage-plugin/src/index.ts";