extensions/oni-plugin-prettier/requirePackage.js
function requireLocalPkg(fspath, pkgName) {
    const modulePath = findPkg(fspath, pkgName)
    if (modulePath) {
        try {
            return require(modulePath)
        } catch (e) {
            console.warn(`Failed to load ${pkgName} from ${modulePath}. Using bundled`)
        }
    }

    return require(pkgName)
}
function requireLocalPkg(fspath, pkgName) {
    const modulePath = findPkg(fspath, pkgName)
    if (modulePath) {
        try {
            return require(modulePath)
        } catch (e) {
            console.warn(`Failed to load ${pkgName} from ${modulePath}. Using bundled`)
        }
    }

    return require(pkgName)
}
function requireLocalPkg ( fspath , pkgName ) { const modulePath = findPkg ( fspath , pkgName ) if ( modulePath ) { try { return require ( modulePath ) } catch ( e ) { console . warn ( ` ${ pkgName } ${ modulePath } ` ) } } return require ( pkgName ) }
Require package explicitely installed relative to given path.
Fallback to bundled one if no pacakge was found bottom up.
@param {string} fspath file system path starting point to resolve package
@param {string} pkgName package's name to require
@returns module
Require package explicitely installed relative to given path . Fallback to bundled one if no pacakge was found bottom up .