'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports['default'] = install;

var _crossSpawn = require('cross-spawn');

var _crossSpawn2 = _interopRequireDefault(_crossSpawn);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

/**
 * 执行`npm i`安装依赖
 * @param {*} cb callback 安装依赖完成后回调
 */
function install(cb) {
  var child = (0, _crossSpawn2['default'])('npm', ['i'], { stdio: 'inherit' });
  child.on('close', function (code) {
    cb(code);
  });
}