Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

get-pkgs

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-pkgs - npm Package Compare versions

Comparing version
0.5.0
to
0.6.0
+21
-12
index.js

@@ -12,3 +12,8 @@ /*!

module.exports = function get(repos, cb) {
module.exports = function get(repos, options, cb) {
if (typeof options === 'function') {
cb = options;
options = {};
}
if (typeof cb !== 'function') {

@@ -27,19 +32,23 @@ throw new TypeError('expected a callback function');

utils.reduce(repos, [], function(acc, name, next) {
options = options || {};
utils.each(repos, function(name, next) {
utils.pkg(name, function(err, pkg) {
if (err) {
if (err.code === 404) {
var symbol = utils.yellow(utils.warning);
console.error('', symbol, 'WARNING: npm package "' + err.pkgName + '" does not exist');
next(null, acc);
if (err.message === 'document not found' && options.silent) {
next();
return;
}
if (err && err.message !== 'document not found') {
next(err);
return;
}
next(err);
return;
}
next(null, acc.concat(pkg || []));
next(null, pkg);
});
}, cb);
}, function(err, pkgs) {
if (err) {
cb(err);
return;
}
cb(null, pkgs.filter(Boolean));
});
};
{
"name": "get-pkgs",
"description": "Get the package.json for an array of repos from the npm registry, optionally filtering properties using glob patterns.",
"version": "0.5.0",
"version": "0.6.0",
"homepage": "https://github.com/jonschlinkert/get-pkgs",

@@ -24,12 +24,9 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",

"dependencies": {
"ansi-yellow": "^0.1.1",
"async-array-reduce": "^0.1.0",
"async-each": "^1.0.0",
"get-pkg": "^0.3.0",
"lazy-cache": "^1.0.3",
"warning-symbol": "^0.1.0"
"lazy-cache": "^2.0.1"
},
"devDependencies": {
"gulp-format-md": "^0.1.7",
"mocha": "^2.4.5",
"should": "^8.3.0"
"gulp-format-md": "^0.1.9",
"mocha": "^2.5.3"
},

@@ -36,0 +33,0 @@ "keywords": [

@@ -11,6 +11,4 @@ 'use strict';

require('async-array-reduce', 'reduce');
require('async-each', 'each');
require('get-pkg', 'pkg');
require('warning-symbol', 'warning');
require('ansi-yellow', 'yellow');
require = fn;

@@ -17,0 +15,0 @@

# get-pkgs [![NPM version](https://img.shields.io/npm/v/get-pkgs.svg?style=flat)](https://www.npmjs.com/package/get-pkgs) [![NPM downloads](https://img.shields.io/npm/dm/get-pkgs.svg?style=flat)](https://npmjs.org/package/get-pkgs) [![Build Status](https://img.shields.io/travis/jonschlinkert/get-pkgs.svg?style=flat)](https://travis-ci.org/jonschlinkert/get-pkgs)
> Get the package.json for an array of repos from the npm registry, optionally filtering properties using glob patterns.
## Install
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install get-pkgs --save
```
## Usage
```js
var getPkgs = require('get-pkgs');
getPkgs(['assemble', 'verb'], function(err, pkgs) {
console.log(pkgs);
});
```
## Related projects
You might also be interested in these projects:
* [get-first-commit](https://www.npmjs.com/package/get-first-commit): Returns a git repository's first commit as a JavaScript object. | [homepage](https://github.com/jonschlinkert/get-first-commit)
* [get-pkg](https://www.npmjs.com/package/get-pkg): Get the package.json for a project from npm. | [homepage](https://github.com/jonschlinkert/get-pkg)
* [github-base](https://www.npmjs.com/package/github-base): Base methods for creating node.js apps that work with the GitHub API. | [homepage](https://github.com/jonschlinkert/github-base)
## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/get-pkgs/issues/new).
## Building docs
Generate readme and API documentation with [verb](https://github.com/verbose/verb):
```sh
$ npm install verb && npm run docs
```
Or, if [verb](https://github.com/verbose/verb) is installed globally:
```sh
$ verb
```
## Running tests
Install dev dependencies:
```sh
$ npm install -d && npm test
```
## Author
**Jon Schlinkert**
* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
## License
Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT license](https://github.com/jonschlinkert/get-pkgs/blob/master/LICENSE).
***
_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on April 11, 2016._