We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2b472ff + 9402e23 commit 7bc2852Copy full SHA for 7bc2852
lib/W3CValidator.js
@@ -20,6 +20,7 @@ var pkg = require("../package.json");
20
program.version(pkg.version)
21
.usage("[options] <url>")
22
.option("-l, --log", "log errors in a text file")
23
+ .option("-m, --max <n>", "max URLs to crawl")
24
.option("-q, --query", "consider query string")
25
.option("-v, --verbose", "show error details")
26
.parse(process.argv);
@@ -160,6 +161,10 @@ W3CValidator.prototype.create = function() {
160
161
162
this.crawler.on("fetchcomplete", (item) => {
163
this.chunk.push(item.url);
164
+ if (program.max && this.chunk.length >= program.max) {
165
+ this.crawler.emit("complete");
166
+ this.crawler.stop();
167
+ }
168
});
169
170
this.crawler.on("complete", () => {
0 commit comments