snapshot-fs
Version:
Create a filesystem snapshot for use with memfs
32 lines • 929 B
TypeScript
import { type sep } from 'node:path';
import { type SnapshotForKind, type SnapshotKind } from './read.js';
/**
* Options for functions in this module
*/
export interface ExportSnapshotOptions {
/**
* Destination directory
*/
dest?: string;
/**
* If `true`, write to a virtual filesystem and dump a difflike tree
*/
dryRun?: boolean;
/**
* Path separator in snapshot (?)
*/
separator?: typeof sep;
}
/**
* Exports a snapshot to the _real_ filesystem.
*
* Creates the directory if it does not exist.
*
* @remarks
* `memfs` sure makes "dry runs" easier, doesn't it?
* @param kind Snapshot kind
* @param data Snapshot data
* @param options Options
*/
export declare function exportSnapshot<K extends SnapshotKind, T extends SnapshotForKind<K>>(kind: K, data: T, { dest, dryRun, separator }?: ExportSnapshotOptions): Promise<void>;
//# sourceMappingURL=export.d.ts.map