Skip to content

Minima.js API


Minima.js API / @minimajs/disk / snapshot / restore

Function: restore() ​

ts
function restore(
   snapshotFile, 
   src, 
   dest?, 
options?): Promise<void>;

Restore a snapshot ZIP from src into dest (defaults to src if omitted). The ZIP is streamed — individual files are never fully buffered in memory.

Parameters ​

snapshotFile ​

string

src ​

Disk

dest? ​

Disk = src

options? ​

RestoreOptions = {}

Returns ​

Promise<void>

Example ​

ts
// Restore to same disk
await restore('snapshots/....zip', localDisk)

// Restore from S3 backup to local
await restore('snapshots/....zip', s3Disk, localDisk)

// Restore to a different path
await restore('snapshots/....zip', s3Disk, localDisk, { targetPath: 'restored/' })