dependency-hunter
Advanced tools
Comparing version 2.0.0 to 3.0.0
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
8940
201
51
6
+ Addedxtend@^4.0.1
+ Addedansi-regex@2.1.1(transitive)
+ Addedapplication-config@1.0.1(transitive)
+ Addedapplication-config-path@0.1.1(transitive)
+ Addedbl@1.1.2(transitive)
+ Addedcode-point-at@1.1.0(transitive)
+ Addedduplexer2@0.0.2(transitive)
+ Addedghauth@3.2.1(transitive)
+ Addedhyperquest@2.0.0(transitive)
+ Addedis-fullwidth-code-point@1.0.0(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addednumber-is-nan@1.0.1(transitive)
+ Addedprocess-nextick-args@1.0.7(transitive)
+ Addedreadable-stream@1.1.142.0.6(transitive)
+ Addedsingle-line-log@1.1.2(transitive)
+ Addedstring-width@1.0.2(transitive)
+ Addedstrip-ansi@3.0.1(transitive)
+ Addedthrough2@0.6.5(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedxtend@4.0.2(transitive)
- Removedbl@0.7.0(transitive)
- Removedduplexer@0.1.2(transitive)
- Removedghauth@0.3.1(transitive)
- Removedhyperquest@0.2.0(transitive)
- Removedmkdirp@0.3.5(transitive)
- Removedobject-keys@0.4.0(transitive)
- Removedprocess@0.5.2(transitive)
- Removedsingle-line-log@0.4.1(transitive)
- Removedstream-browserify@0.1.3(transitive)
- Removedthrough@2.2.7(transitive)
- Removedxtend@2.1.2(transitive)
Updatedafter-all@^2.0.2
Updatedghauth@^3.0.0
Updatedgithub@^0.2.4
Updatedrequest@^2.58.0
Updatedsingle-line-log@^1.0.0