bower-locker-status.js
function status(isVerbose) {
    // Load bower.json and make sure it is a locked bower.json file
    var bowerConfigStr = fs.readFileSync('bower.json', {encoding: 'utf8'});
    var bowerConfig = JSON.parse(bowerConfigStr);
    var locked = bowerConfig.bowerLocker;
    if (locked) {
        var timeDiff = (new Date()).getTime() - (new Date(locked.lastUpdated)).getTime();
        console.log('bower.json was locked as of %s (%s)', locked.lastUpdated, formatTimeDiff(timeDiff));
        if (isVerbose) {
            console.log('Currently locked dependencies:');
            Object.keys(locked.lockedVersions).forEach(function(key) {
                console.log('  %s (%s): %s', key, locked.lockedVersions[key], bowerConfig.resolutions[key]);
            });
        }
    } else {
        console.log('The bower.json is currently unlocked.\n');
    }
}
function status(isVerbose) {
    // Load bower.json and make sure it is a locked bower.json file
    var bowerConfigStr = fs.readFileSync('bower.json', {encoding: 'utf8'});
    var bowerConfig = JSON.parse(bowerConfigStr);
    var locked = bowerConfig.bowerLocker;
    if (locked) {
        var timeDiff = (new Date()).getTime() - (new Date(locked.lastUpdated)).getTime();
        console.log('bower.json was locked as of %s (%s)', locked.lastUpdated, formatTimeDiff(timeDiff));
        if (isVerbose) {
            console.log('Currently locked dependencies:');
            Object.keys(locked.lockedVersions).forEach(function(key) {
                console.log('  %s (%s): %s', key, locked.lockedVersions[key], bowerConfig.resolutions[key]);
            });
        }
    } else {
        console.log('The bower.json is currently unlocked.\n');
    }
}
function status ( isVerbose ) { // Load bower.json and make sure it is a locked bower.json file var bowerConfigStr = fs . readFileSync ( 'bower.json' , { encoding : 'utf8' } ) ; var bowerConfig = JSON . parse ( bowerConfigStr ) ; var locked = bowerConfig . bowerLocker ; if ( locked ) { var timeDiff = ( new Date ( ) ) . getTime ( ) - ( new Date ( locked . lastUpdated ) ) . getTime ( ) ; console . log ( 'bower.json was locked as of %s (%s)' , locked . lastUpdated , formatTimeDiff ( timeDiff ) ) ; if ( isVerbose ) { console . log ( 'Currently locked dependencies:' ) ; Object . keys ( locked . lockedVersions ) . forEach ( function ( key ) { console . log ( '  %s (%s): %s' , key , locked . lockedVersions [ key ] , bowerConfig . resolutions [ key ] ) ; } ) ; } } else { console . log ( 'The bower.json is currently unlocked.\n' ) ; } }
Function to output the current status of the `bower.json` file.
Indicates whether it is locked, when it was locked, and if verbose the locked version of the dependencies.
@param {Boolean} isVerbose Flag to indicate whether we should log verbosely or not
Function to output the current status of the bower . json file . Indicates whether it is locked when it was locked and if verbose the locked version of the dependencies .