UNPKG

560 BJavaScriptView Raw
1/*!
2 * get-pkgs <https://github.com/jonschlinkert/get-pkgs>
3 *
4 * Copyright (c) 2014-2015, Jon Schlinkert.
5 * Licensed under the MIT License.
6 */
7
8'use strict';
9
10var utils = require('./utils');
11
12module.exports = function get(repos, cb) {
13 if (typeof cb !== 'function') {
14 throw new TypeError('expected callback to be a function');
15 }
16
17 if (typeof repos === 'string') {
18 repos = [repos];
19 }
20
21 if (!Array.isArray(repos)) {
22 throw new TypeError('expected the first argument to be a string or array');
23 }
24 utils.async.map(repos, utils.pkg, cb);
25};