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
1.0.0
to
1.1.0
+12
-16
index.js

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

module.exports = function get(names, options = {}, cb) {
module.exports = (names, options, cb) => {
if (typeof options === 'function') {

@@ -19,16 +19,12 @@ cb = options;

if (typeof names === 'string') {
names = [names];
}
names = [].concat(names || []);
let opts = options || {};
let pending = [];
let pkgs = [];
const pending = [];
const pkgs = [];
for (const name of names) {
const promise = pkg(name)
.then(res => {
if (res) pkgs.push(res);
})
for (let name of names) {
let promise = pkg(name)
.then(res => res && pkgs.push(res))
.catch(err => {
if (err.message === 'document not found' && options.silent) return;
if (err.message === 'document not found' && opts.silent) return;
return Promise.reject(err);

@@ -40,10 +36,10 @@ });

const promise = Promise.all(pending);
let p = Promise.all(pending);
if (typeof cb === 'function') {
promise.then(() => cb(null, pkgs)).catch(cb);
p.then(() => cb(null, pkgs)).catch(cb);
return;
}
return promise.then(() => pkgs);
return p.then(() => pkgs);
};
{
"name": "get-pkgs",
"description": "Get the package.json for an array of repos from the npm registry, optionally filtering properties using glob patterns.",
"version": "1.0.0",
"version": "1.1.0",
"homepage": "https://github.com/jonschlinkert/get-pkgs",

@@ -16,2 +16,5 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",

"main": "index.js",
"engines": {
"node": ">=4"
},
"scripts": {

@@ -21,6 +24,6 @@ "test": "mocha"

"dependencies": {
"get-pkg": "^1.0.0"
"get-pkg": "^1.1.0"
},
"devDependencies": {
"gulp-format-md": "^1.0.0",
"gulp-format-md": "^2.0.0",
"mocha": "^5.2.0"

@@ -27,0 +30,0 @@ },

@@ -70,3 +70,3 @@ # get-pkgs [![NPM version](https://img.shields.io/npm/v/get-pkgs.svg?style=flat)](https://www.npmjs.com/package/get-pkgs) [![NPM monthly downloads](https://img.shields.io/npm/dm/get-pkgs.svg?style=flat)](https://npmjs.org/package/get-pkgs) [![NPM total downloads](https://img.shields.io/npm/dt/get-pkgs.svg?style=flat)](https://npmjs.org/package/get-pkgs) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/get-pkgs.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/get-pkgs)

* [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 "Get the package.json for a project from npm.")
* [github-base](https://www.npmjs.com/package/github-base): JavaScript wrapper that greatly simplifies working with GitHub's API. | [homepage](https://github.com/jonschlinkert/github-base "JavaScript wrapper that greatly simplifies working with GitHub's API.")
* [github-base](https://www.npmjs.com/package/github-base): Low-level methods for working with the GitHub API in node.js/JavaScript. | [homepage](https://github.com/jonschlinkert/github-base "Low-level methods for working with the GitHub API in node.js/JavaScript.")

@@ -77,5 +77,5 @@ ### Author

* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
* [GitHub Profile](https://github.com/jonschlinkert)
* [Twitter Profile](https://twitter.com/jonschlinkert)
* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)

@@ -89,2 +89,2 @@ ### License

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 28, 2018._
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on December 08, 2018._