Skip to content

Commit

Permalink
20150309, V0.0.7, Extended package description, Corrected link syntax…
Browse files Browse the repository at this point in the history
… in README
  • Loading branch information
mwittig committed Mar 9, 2015
1 parent 9455499 commit 4f154bc
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 4 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
NPM License Crawler
===================

NPM License Crawler is a wrapper around [license-checker] (https://github.com/davglass/license-checker) to analyze
NPM License Crawler is a wrapper around [license-checker](https://github.com/davglass/license-checker) to analyze
several node packages (package.json files) as part of your software project. This way, it is possible to create a list
of third party licenses for your software project in one go. File paths containing ".git" or "node_modules" are ignored
at the stage where 'package.json' files are matched to provide the entry points to calling license-checker.
Expand Down Expand Up @@ -70,6 +70,10 @@ History
* Renamed binary
* npm publish

* 20150309, V0.0.7
* Extended package description
* Corrected link syntax in README

Todo
----

Expand Down
22 changes: 20 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "npm-license-crawler",
"version": "0.0.6",
"version": "0.0.7",
"description": "Analyzes license information for multiple node.js modules (package.json files) as part of your software project.",
"main": "./lib/index.js",
"bin": {
Expand All @@ -23,5 +23,23 @@
"test": "istanbul cover --print both vows --"
},
"author": "Marcus Wittig",
"license": "BSD"
"bugs": {
"url": "http://github.com/mwittig/npm-license-crawler/issues"
},
"licenses": [
{
"type": "BSD",
"url": "https://github.com/mwittig/npm-license-crawler/blob/master/LICENSE"
}
],
"repository": {
"type": "git",
"url": "http://github.com/mwittig/npm-license-crawler.git"
},
"keywords": [
"license",
"npm",
"checker",
"crawler"
]
}
39 changes: 38 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var vows = require('vows'),
assert = require('assert'),
DirectoryReader = require('../lib/directoryreader'),
index = require('../lib/index'),
tests = {
loading: {
Expand All @@ -9,7 +10,43 @@ var vows = require('vows'),
'should load callback': function (topic) {
assert.isFunction(topic);
}
},
reader: {
topic: function() {
var reader = new DirectoryReader(".."),
result = {
found: false,
dirs: 0,
files: 0
},
self = this;

reader.on("file", function (file, stat, fullPath) {
result.files++;
if (file === "test.js") {
result.found = true;
}
reader.next();
});
reader.on("dir", function (dir) {
result.dirs++;
if (dir === "node_modules") {
reader.next();
}
else {
reader.list();
}
});
reader.on("done", function (error) {
self.callback(error, result)
});
},
'should find test file': function (result) {
assert(result.found);
assert(result.dirs > 0);
assert(result.files > 0);
}
}
};

vows.describe('dumplicenses').addBatch(tests).export(module);
vows.describe('dumplicenses').addBatch(tests).export(module);

0 comments on commit 4f154bc

Please sign in to comment.