all files / lib/component/ getConfig.js

100% Statements 10/10
50% Branches 1/2
100% Functions 1/1
100% Lines 10/10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19                 
'use strict';
 
var path = require('path');
 
var fs = require('graceful-fs');
var jsonfile = require('jsonfile');
 
var fecom = require('../fecom');
 
module.exports = function (options) {
  var componentJson = path.join(options.cwd, 'component.json');
  var json = {};
 
  Eif (fs.existsSync(componentJson)) {
    json = jsonfile.readFileSync(componentJson);
  }
 
  return fecom.async(json);
};