From 4f154bc6cc1b3f11f60f3f57b0ee897478da920a Mon Sep 17 00:00:00 2001 From: marcus Date: Mon, 9 Mar 2015 11:58:39 +0100 Subject: [PATCH] 20150309, V0.0.7, Extended package description, Corrected link syntax in README --- README.md | 6 +++++- package.json | 22 ++++++++++++++++++++-- test/test.js | 39 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 63 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 15e36a1..af22bbc 100644 --- a/README.md +++ b/README.md @@ -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. @@ -70,6 +70,10 @@ History * Renamed binary * npm publish +* 20150309, V0.0.7 + * Extended package description + * Corrected link syntax in README + Todo ---- diff --git a/package.json b/package.json index 04e3e07..023f4e3 100644 --- a/package.json +++ b/package.json @@ -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": { @@ -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" + ] } \ No newline at end of file diff --git a/test/test.js b/test/test.js index c0c8d27..670c280 100644 --- a/test/test.js +++ b/test/test.js @@ -1,5 +1,6 @@ var vows = require('vows'), assert = require('assert'), + DirectoryReader = require('../lib/directoryreader'), index = require('../lib/index'), tests = { loading: { @@ -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); \ No newline at end of file