all files / mlpm/lib/commands/ info.js

100% Statements 12/12
100% Branches 4/4
100% Functions 2/2
100% Lines 11/11
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24                         
'use strict'
 
var log = require('winston')
var pj  = require('prettyjson')
  , api = require('../api.js')
  , project = require('../project.js')
 
function showInfo(err, data) {
  if (err) return log.error(err)
  log.info( pj.render(data) )
}
 
function info(args) {
  if (args.package) {
    api.info(args.package, args.version, showInfo)
  } else {
    project.getConfig(showInfo)
  }
}
 
info.usage = 'mlpm info <package>'
 
module.exports.command = info