import { h as u, s as ur, t as C } from "./chunk-VBDAOXYI-Dd3pepio.mjs";
import * as s from "fs";
import * as o from "path";
//#region node_modules/@electric-sql/pglite/dist/fs/nodefs.js
u();
var m = class extends ur {
	constructor(t) {
		super(t), this.rootDir = o.resolve(t), s.existsSync(o.join(this.rootDir)) || s.mkdirSync(this.rootDir);
	}
	async init(t, e) {
		return this.pg = t, { emscriptenOpts: {
			...e,
			preRun: [...e.preRun || [], (r) => {
				let c = r.FS.filesystems.NODEFS;
				r.FS.mkdir(C), r.FS.mount(c, { root: this.rootDir }, C);
			}]
		} };
	}
	async closeFs() {
		this.pg.Module.FS.quit();
	}
};
//#endregion
export { m as NodeFS };

//# sourceMappingURL=nodefs-DPTAyPiM.mjs.map