Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dependency-hunter

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dependency-hunter - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

52

dependency-hunter.js

@@ -9,4 +9,4 @@ #!/usr/bin/env node

var path = require('path');
var readline = require('readline');
var afterAll = require('after-all');
var extend = require('xtend');

@@ -19,3 +19,3 @@ var HOME = process.env.HOME || process.env.USERPROFILE;

var update = function(organization, token) {
var update = function(organization) {
var listOfRepos = function(callback) {

@@ -73,34 +73,42 @@ var page = 1;

repos.forEach(function(repository) {
var onend = next();
var loadJson = function(file, repository, callback) {
github.repos.getContent({
user: organization,
repo: repository.name,
path: '/package.json'
path: file
}, function(err, res) {
log('Left to download:', --left);
// File is not there
if (err && err.code === 404) return callback(null, {});
if (err && err.code === 404) return onend();
if (err) throw err;
var body;
var json;
try {
body = JSON.parse(new Buffer(res.content, 'base64'));
json = JSON.parse(new Buffer(res.content, 'base64'));
}
catch(e) {
console.log('Could not parse body for '+repository.name);
console.log(res);
return onend();
// File is not proper json
return callback(new Error('Could not parse body for '+repository.name));
}
result[repository.name] = {
dependencies: body.dependencies,
devDependencies: body.devDependencies
};
callback(null, json);
});
};
onend();
repos.forEach(function(repository) {
var onend = next();
loadJson('/package.json', repository, function(err, npmModules) {
if (err) console.error(err);
loadJson('/bower.json', repository, function(err, bowerModules) {
if (err) console.error(err);
result[repository.name] = {
dependencies: extend(npmModules.dependencies, bowerModules.dependencies),
devDependencies: extend(npmModules.devDependencies, bowerModules.devDependencies)
};
onend();
});
});
});
});

@@ -217,3 +225,3 @@ };

if (command === 'update') {
update(organization, token);
update(organization);
} else if (command === 'list') {

@@ -220,0 +228,0 @@ listModules(organization);

{
"name": "dependency-hunter",
"version": "2.0.0",
"version": "3.0.0",
"description": "Find node.js dependencies in github repositories. Goes through package.json in each repository so you can easily find dependencies and devDependencies",

@@ -25,9 +25,10 @@ "keywords": [

},
"repository": "git@github.com:e-conomic/dependency-hunter.git",
"repository": "git@github.com:freeall/dependency-hunter.git",
"dependencies": {
"after-all": "^2.0.0",
"ghauth": "^0.3.1",
"github": "^0.2.1",
"request": "^2.38.0",
"single-line-log": "^0.4.1"
"after-all": "^2.0.2",
"ghauth": "^3.0.0",
"github": "^0.2.4",
"request": "^2.58.0",
"single-line-log": "^1.0.0",
"xtend": "^4.0.1"
},

@@ -34,0 +35,0 @@ "author": "Tobias Baunbæk <tba@e-conomic.com>",

@@ -1,2 +0,2 @@

# dependency-hunter
# dependency-hunter [![npm version](https://badge.fury.io/js/dependency-hunter.svg)](http://badge.fury.io/js/dependency-hunter) [![Dependency Status](https://david-dm.org/freeall/dependency-hunter.svg)](https://david-dm.org/freeall/dependency-hunter)

@@ -7,3 +7,3 @@ Find module dependencies in github repositories.

Goes through `package.json` in each repository so you can easily find dependencies and devDependencies in each repository. Works both for users and organizations.
Goes through `package.json` and `bower.json` in each repository so you can easily find dependencies and devDependencies in each repository. Works both for users and organizations.

@@ -13,3 +13,3 @@ If I wanted to find out how many of my own repositories that uses `request` I would run:

```
$ depency-hunter find freeall request
$ dependency-hunter find freeall request
```

@@ -52,2 +52,2 @@

MIT
MIT

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc