format import fs from 'fs-extra' ; import open from 'open' ; export async function openFile ( path ) { if ( ! path ) { return ; } let fileStat ; try { fileStat = await fs . stat ( path ) ; } catch ( err ) { throw new Error ( `Couldn't open file: ${ path }: ${ err }` ) ; } if ( fileStat . size <= 8 ) { throw new Error ( 'File seems to be (almost) empty: ' + path ) ; } await open ( path ) ; }