lib/config/config-initializer.js
function getPeerDependencies(moduleName) {
    let result = getPeerDependencies.cache.get(moduleName);

    if (!result) {
        log.info(`Checking peerDependencies of ${moduleName}`);

        result = npmUtils.fetchPeerDependencies(moduleName);
        getPeerDependencies.cache.set(moduleName, result);
    }

    return result;
}
function getPeerDependencies(moduleName) {
    let result = getPeerDependencies.cache.get(moduleName);

    if (!result) {
        log.info(`Checking peerDependencies of ${moduleName}`);

        result = npmUtils.fetchPeerDependencies(moduleName);
        getPeerDependencies.cache.set(moduleName, result);
    }

    return result;
}
function getPeerDependencies ( moduleName ) { let result = getPeerDependencies . cache . get ( moduleName ) ; if ( ! result ) { log . info ( ` ${ moduleName } ` ) ; result = npmUtils . fetchPeerDependencies ( moduleName ) ; getPeerDependencies . cache . set ( moduleName , result ) ; } return result ; }
Get the peer dependencies of the given module.
This adds the gotten value to cache at the first time, then reuses it.
In a process, this function is called twice, but `npmUtils.fetchPeerDependencies` needs to access network which is relatively slow.
@param {string} moduleName The module name to get.
@returns {Object} The peer dependencies of the given module.
This object is the object of `peerDependencies` field of `package.json`.
Returns null if npm was not found.
Get the peer dependencies of the given module . This adds the gotten value to cache at the first time then reuses it . In a process this function is called twice but npmUtils . fetchPeerDependencies needs to access network which is relatively slow .