@phi-ag/rvt
Version:
Parse Revit file format
14 lines (13 loc) • 428 B
JavaScript
import { openAsBlob } from "node:fs";
import { BlobSource, Cfb } from "./cfb/index.js";
export const openPath = async (path) => Cfb.initialize(new BlobSource(await openAsBlob(path)));
export const tryOpenPath = async (path) => {
try {
return { ok: true, data: await openPath(path) };
}
catch (e) {
if (e instanceof Error)
return { ok: false, error: e.message };
throw e;
}
};