
Product
Announcing Socket Certified Patches: One-Click Fixes for Vulnerable Dependencies
A safer, faster way to eliminate vulnerabilities without updating dependencies
@ifc-x/convert
Advanced tools
A JavaScript library and CLI tool for converting IFC/FRAG files into formats like SQLite/FRAG and (SOON) Excel. Supports both Node.js and browser environments.
npm install @ifc-x/convert
For global CLI usage:
npm install -g @ifc-x/convert
ifc-x-convert <input.ifc> <output.db>
Example:
ifc-x-convert model.ifc model.sqlite
This reads an IFC file and writes the result as SQLite. Progress updates are printed to the console.
import { convert } from "@ifc-x/convert";
const result = await convert("path/to/model.ifc", {
inputType: "ifc",
outputType: "sqlite",
progressCallback: (p) => console.log(`Progress: ${p}%`),
});
// result is a Uint8Array, ready to be saved
import { Converter } from "@ifc-x/convert";
const converter = new Converter();
// Example middleware: modify data before writing
converter.use(async (data) => {
// custom transformation
return data;
});
const ifcBytes = new Uint8Array(/* ... */);
const result = await converter.convert(ifcBytes, {
inputType: "ifc",
outputType: "sqlite",
});
convert(input, options)Convert a file or buffer using the global registry.
input: string | File | Blob | ArrayBuffer | Uint8Array
options:
inputType (string) – type of input (e.g., ifc, frag)outputType (string) – type of output (e.g., sqlite, xlsx)env ("node" | "browser") – execution environmentreaderClass (Function) – force a specific readerwriterClass (Function) – force a specific writermiddleware (Function[]) – array of transformation functionsprogressCallback (Function) – progress updates (0–100)Returns: Promise<Uint8Array>
ConverterClass for advanced conversion workflows.
new Converter(options)env: "node" or "browser"readerClass: custom readerwriterClass: custom writeruse(fn) – add a middleware functiondetectType(input) – detect file typeconvert(input, options) – perform conversionregistryA global registry that manages available readers and writers. The converter uses it to automatically detect the best match for a given environment and format.
addReader(readerClass) – register a new reader classaddWriter(writerClass) – register a new writer classfindReader(env, type) – find the best reader for an environment and input typefindWriter(env, format) – find the best writer for an environment and output formatReaders and writers must define:
environments: array of supported environments (["node"], ["browser"], or both)formats: array of supported formats (e.g., ["ifc"], ["frag"], ["sqlite"])priority: number used to choose between multiple candidatesclass CustomExcelWriter {
static environments = ["node"];
static formats = ["xlsx"];
static priority = 10;
async write(data, options) {
// implement writing to Excel
return new Uint8Array();
}
}
import { registry } from "@ifc-x/convert";
registry.addWriter(CustomExcelWriter);
npm run examples – Run examplesnpm build – Build dist versionnpm test – Run testsMIT © Lauri Tunnela
FAQs
Convert IFC/FRAG files to FRAG/SQLite in Node.js, browser and CLI.
We found that @ifc-x/convert demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
A safer, faster way to eliminate vulnerabilities without updating dependencies

Product
Reachability analysis for Ruby is now in beta, helping teams identify which vulnerabilities are truly exploitable in their applications.

Research
/Security News
Malicious npm packages use Adspect cloaking and fake CAPTCHAs to fingerprint visitors and redirect victims to crypto-themed scam sites.