'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var fs_fs = require('../fs/fs.js');
var nodejs_path = require('../nodejs/path.js');
require('../nodejs/crypto.js');
require('../nodejs/fs.js');
require('../nodejs/os.js');

/**
 * 获取依赖列表
 * @param dir 目录
 * @returns dependenciesList
 * @example
 * ```ts
 * // 假设 ./package.json 中 dependencies 包含 axios、lodash
 * getDeps('./');
 * // ['axios', 'lodash']
 * ```
 */
function getDeps(dir) {
  var data = fs_fs.readFileSync(nodejs_path.getPath().resolve(dir, 'package.json'), true);
  return Object.keys(Object.assign({}, data.dependencies));
}

exports.getDeps = getDeps;
