UNPKG

electron-rebuild

Version:

Electron supporting package to rebuild native node modules against the currently installed electron

15 lines (13 loc) 296 B
import * as fs from 'fs-extra'; import * as path from 'path'; export async function readPackageJson(dir: string, safe = false) { try { return await fs.readJson(path.resolve(dir, 'package.json')); } catch (err) { if (safe) { return {}; } else { throw err; } } }