jsonconsole.js
function setup(userOptions) {

    Object.assign(options, userOptions);

    /*
        Try to automatically grab the app name from the root directory
     */  
    if (!options.root) {
        try {
            var p = require(path.dirname(process.mainModule.filename) + '/package.json');
            options.root = path.dirname(process.mainModule.filename);
            options.name = p.name;
        } catch (e) {
            options.root = null;    
        }
    }

    if (options.root && !options.name) {
        try {
            var p = require(options.root + '/package.json');
            options.name = p.name;
        } catch (e) {
        }
    }

    /*
        In production mode, define default log threshold to info
     */
    if (process.env.LOG_LEVEL === undefined && process.env.NODE_ENV === "production") {
        process.env.LOG_LEVEL = "info";
    }

    options.name = options.name || ".";
    replace();
    return restore;
}
function setup(userOptions) {

    Object.assign(options, userOptions);

    /*
        Try to automatically grab the app name from the root directory
     */  
    if (!options.root) {
        try {
            var p = require(path.dirname(process.mainModule.filename) + '/package.json');
            options.root = path.dirname(process.mainModule.filename);
            options.name = p.name;
        } catch (e) {
            options.root = null;    
        }
    }

    if (options.root && !options.name) {
        try {
            var p = require(options.root + '/package.json');
            options.name = p.name;
        } catch (e) {
        }
    }

    /*
        In production mode, define default log threshold to info
     */
    if (process.env.LOG_LEVEL === undefined && process.env.NODE_ENV === "production") {
        process.env.LOG_LEVEL = "info";
    }

    options.name = options.name || ".";
    replace();
    return restore;
}
function setup ( userOptions ) { Object . assign ( options , userOptions ) ; /*
        Try to automatically grab the app name from the root directory
     */ if ( ! options . root ) { try { var p = require ( path . dirname ( process . mainModule . filename ) + '/package.json' ) ; options . root = path . dirname ( process . mainModule . filename ) ; options . name = p . name ; } catch ( e ) { options . root = null ; } } if ( options . root && ! options . name ) { try { var p = require ( options . root + '/package.json' ) ; options . name = p . name ; } catch ( e ) { } } /*
        In production mode, define default log threshold to info
     */ if ( process . env . LOG_LEVEL === undefined && process . env . NODE_ENV === "production" ) { process . env . LOG_LEVEL = "info" ; } options . name = options . name || "." ; replace ( ) ; return restore ; }
Setup JSON console
@param  {Object} userOptions [description]
@return {Function} a restore function that restore the behavior of classic console
Setup JSON console