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 | ;
|
9 |
|
10 | var utils = require('./utils');
|
11 |
|
12 | module.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 | };
|