UNPKG

@radcliffetech/symbolos-core

Version:

Core symbolic simulation and execution engine for Symbolos

16 lines (15 loc) 514 B
import * as fs from 'node:fs/promises'; import * as zlib from 'zlib'; import { promisify } from 'util'; export async function readJsonGz(filePath) { const gunzip = promisify(zlib.gunzip); try { const data = await fs.readFile(filePath); const buffer = await gunzip(data); const jsonString = buffer.toString('utf-8'); return JSON.parse(jsonString); } catch (error) { throw new Error(`Failed to read or decompress file: ${filePath}\n${error.message}`); } }