UNPKG

lx-scan

Version:

License eXtension to find 5-tuples of all installed packages: name, version, project home page, license (e. g. Apache v2, BSD) and required notice. It includes a GUI to edit information for each package and to enter information if necessary.

131 lines (126 loc) 4.79 kB
var test = require("./test.js"), lx = require("../lx"), expected = {'cookie-parser@1.0.1': 'MIT', 'xmlhttprequest@1.2.2': 'MIT', 'scmp@0.0.3': 'BSD', 'tinycolor@0.0.1': 'MIT', 'core-util-is@1.0.1' :undefined, 'promzard@0.2.0': 'ISC', 'archy@0.0.2': 'MIT', 'buffer-crc32@0.2.1': 'MIT', 'editor@0.0.4':'MIT', 'sha@1.0.1':'MIT', 'stream-counter@0.2.0': 'MIT', 'methods@0.1.0': 'MIT', 'init-package-json@0.0.10': 'ISC', "anyjson@0.3.3": "BSD", } var test_licobjs = [ { name: 'xmlhttprequest', label: 'xmlhttprequest@1.2.2', licensefile: [], repository: 'git://github.com/driverdan/node-XMLHttpRequest.git', repo: 'https://github.com/driverdan/node-XMLHttpRequest', licurl: 'https://github.com/driverdan/node-XMLHttpRequest', dupl: [ 'driverdan', 'node-XMLHttpRequest' ] }, { name: 'buffer-crc32', label: 'buffer-crc32@0.2.1', licensefile: [], repository: 'git://github.com/brianloveswords/buffer-crc32.git', repo: 'https://github.com/brianloveswords/buffer-crc32', licurl: 'https://github.com/brianloveswords/buffer-crc32', dupl: [ 'brianloveswords', 'buffer-crc32' ] }, { name: 'cookie-parser', label: 'cookie-parser@1.0.1', licensefile: [], repository: 'git://github.com/expressjs/cookie-parser.git', repo: 'https://github.com/expressjs/cookie-parser', licurl: 'https://github.com/expressjs/cookie-parser', dupl: [ 'expressjs', 'cookie-parser' ] }, { name: 'scmp', label: 'scmp@0.0.3', licensefile: [], repository: 'git://github.com/freewil/scmp.git', repo: 'https://github.com/freewil/scmp', licurl: 'https://github.com/freewil/scmp', dupl: [ 'freewil', 'scmp' ] }, { name: 'core-util-is', label: 'core-util-is@1.0.1', licensefile: [], repository: 'git://github.com/isaacs/core-util-is', repo: 'https://github.com/isaacs/core-util-is', licurl: 'https://github.com/isaacs/core-util-is', dupl: [ 'isaacs', 'core-util-is' ] }, { name: 'stream-counter', label: 'stream-counter@0.2.0', licensefile: [], repository: 'git://github.com/superjoe30/node-stream-counter.git', repo: 'https://github.com/superjoe30/node-stream-counter', licurl: 'https://github.com/superjoe30/node-stream-counter', dupl: [ 'superjoe30', 'node-stream-counter' ] }, { name: 'methods', label: 'methods@0.1.0', licensefile: [], repository: 'git://github.com/visionmedia/node-methods.git', repo: 'https://github.com/visionmedia/node-methods', licurl: 'https://github.com/visionmedia/node-methods', dupl: [ 'visionmedia', 'node-methods' ] }, { name: 'tinycolor', label: 'tinycolor@0.0.1', licensefile: [], repository: 'git://github.com/einaros/tinycolor.git', repo: 'https://github.com/einaros/tinycolor', licurl: 'https://github.com/einaros/tinycolor', dupl: [ 'einaros', 'tinycolor' ] }, { name: 'archy', label: 'archy@0.0.2', licensefile: [], repository: 'git://github.com/substack/node-archy.git', repo: 'https://github.com/substack/node-archy', licurl: 'https://github.com/substack/node-archy', dupl: [ 'substack', 'node-archy' ] }, { name: 'editor', label: 'editor@0.0.4', licensefile: [], repository: 'git://github.com/substack/node-editor.git', repo: 'https://github.com/substack/node-editor', licurl: 'https://github.com/substack/node-editor', dupl: [ 'substack', 'node-editor' ] }, { name: 'init-package-json', label: 'init-package-json@0.0.10', licensefile: [], repository: 'git://github.com/isaacs/init-package-json', repo: 'https://github.com/isaacs/init-package-json', licurl: 'https://github.com/isaacs/init-package-json', dupl: [ 'isaacs', 'init-package-json' ] }, { name: 'promzard', label: 'promzard@0.2.0', licensefile: [], repository: 'git://github.com/isaacs/promzard', repo: 'https://github.com/isaacs/promzard', licurl: 'https://github.com/isaacs/promzard', dupl: [ 'isaacs', 'promzard' ] }, { name: 'sha', label: 'sha@1.0.1', licensefile: [], repository: 'https://github.com/ForbesLindesay/sha.git', repo: 'https://github.com/ForbesLindesay/sha', licurl: 'https://github.com/ForbesLindesay/sha', dupl: [ 'ForbesLindesay', 'sha' ] }, { name: "anyjson", label: "anyjson@0.3.3", licensefile: [], repository: "http://bitbucket.org/runeh/anyjson", repo: "http://bitbucket.org/runeh/anyjson", } ]; lx("test","",{test_licobjs: test_licobjs},function (error,results) { results.forEach(function(o) { test( {value: o.label, license: o.license}, function(a){ return expected[a] }, o.license, o.label) }) });