UNPKG

statistician

Version:

Create and compare files stats, and webpack bundle stats

15 lines (12 loc) 276 B
const {readFile} = require('../afsync'); module.exports = async (file, def = {}) => { if (!file) { return {}; } try { return JSON.parse((await readFile(file)).toString()) } catch (error) { console.error(error); // eslint-disable-line no-console return def; } }