lib/cli.js
function printResults(results){
    var output = "";
    var dependenciesTimes = [];
    var devDependenciesTimes = [];

    dependenciesTimes = Object.keys(results.moduleTimes.dependencies).map(function(depen){
        var val = results.moduleTimes.dependencies[depen];

        return [
            chalk.gray(depen),
            " : ",
            chalk.white(val === -1 ? "Cannot be required" : val)
        ];
    });

    devDependenciesTimes = Object.keys(results.moduleTimes.devDependencies).map(function(depen){
        var val = results.moduleTimes.devDependencies[depen];

        return [
            chalk.gray(depen),
            " : ",
            chalk.white(val === -1 ? "Cannot be required" : val)
        ];
    });

    if(dependenciesTimes.length > 0){
        output += chalk.white("Dependencies: \n");
        output += table(dependenciesTimes, {align: ["l", "l"]});
    }

    if(devDependenciesTimes.length > 0){
        output += chalk.white("\n\nDevDependencies: \n");
        output += table(devDependenciesTimes, {align : ["l", "l"]});
    }

    output += chalk.white("\n\nModule load time: " + (results.loadTime === -1 ? "Cannot be required" : results.loadTime));
    console.log(output);
}
function printResults(results){
    var output = "";
    var dependenciesTimes = [];
    var devDependenciesTimes = [];

    dependenciesTimes = Object.keys(results.moduleTimes.dependencies).map(function(depen){
        var val = results.moduleTimes.dependencies[depen];

        return [
            chalk.gray(depen),
            " : ",
            chalk.white(val === -1 ? "Cannot be required" : val)
        ];
    });

    devDependenciesTimes = Object.keys(results.moduleTimes.devDependencies).map(function(depen){
        var val = results.moduleTimes.devDependencies[depen];

        return [
            chalk.gray(depen),
            " : ",
            chalk.white(val === -1 ? "Cannot be required" : val)
        ];
    });

    if(dependenciesTimes.length > 0){
        output += chalk.white("Dependencies: \n");
        output += table(dependenciesTimes, {align: ["l", "l"]});
    }

    if(devDependenciesTimes.length > 0){
        output += chalk.white("\n\nDevDependencies: \n");
        output += table(devDependenciesTimes, {align : ["l", "l"]});
    }

    output += chalk.white("\n\nModule load time: " + (results.loadTime === -1 ? "Cannot be required" : results.loadTime));
    console.log(output);
}
function printResults ( results ) { var output = "" ; var dependenciesTimes = [ ] ; var devDependenciesTimes = [ ] ; dependenciesTimes = Object . keys ( results . moduleTimes . dependencies ) . map ( function ( depen ) { var val = results . moduleTimes . dependencies [ depen ] ; return [ chalk . gray ( depen ) , " : " , chalk . white ( val === - 1 ? "Cannot be required" : val ) ] ; } ) ; devDependenciesTimes = Object . keys ( results . moduleTimes . devDependencies ) . map ( function ( depen ) { var val = results . moduleTimes . devDependencies [ depen ] ; return [ chalk . gray ( depen ) , " : " , chalk . white ( val === - 1 ? "Cannot be required" : val ) ] ; } ) ; if ( dependenciesTimes . length > 0 ) { output += chalk . white ( "Dependencies: \n" ) ; output += table ( dependenciesTimes , { align : [ "l" , "l" ] } ) ; } if ( devDependenciesTimes . length > 0 ) { output += chalk . white ( "\n\nDevDependencies: \n" ) ; output += table ( devDependenciesTimes , { align : [ "l" , "l" ] } ) ; } output += chalk . white ( "\n\nModule load time: " + ( results . loadTime === - 1 ? "Cannot be required" : results . loadTime ) ) ; console . log ( output ) ; }
Prints the results of the run to the console
@param {object} results - Results object from main
@returns {void}
Prints the results of the run to the console