UNPKG

othernpm

Version:

Run npm commands in other directories

29 lines (25 loc) 746 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = configure; /** * Create a configured othernpm function. * @param {Object} param * @param {Object} param.io - Used by othernpm. * @param {Object} param.config - A config object. * @param {Function} param.othernpm - A function which run npm commands. * @return {Function} - A configured othernpm function. */ function configure(_ref) { var io = _ref.io, _ref$config = _ref.config, config = _ref$config === undefined ? {} : _ref$config, othernpm = _ref.othernpm; var onpm = othernpm(io); Object.keys(config).forEach(function (alias) { var path = config[alias]; onpm[alias] = onpm(path); }); return onpm; }