all files / lib/component/ package.js

100% Statements 10/10
100% Branches 0/0
100% Functions 1/1
100% Lines 10/10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16           
'use strict';
 
var path = require('path');
 
var jsonfile = require('jsonfile');
 
module.exports = function (config, options) {
  var packageJson = path.join(options.cwd, 'package.json');
  var packageCfg = {};
 
  packageCfg = jsonfile.readFileSync(packageJson);
  packageCfg.name = config.name;
  packageCfg.description = config.description;
  packageCfg.author = config.author;
  jsonfile.writeFileSync(packageJson, packageCfg, { spaces: 2 });
};