We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3cf159a commit 2447865Copy full SHA for 2447865
1 file changed
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);
@@ -135,6 +136,10 @@ W3CValidator.prototype.create = function() {
135
136
137
this.crawler.on("fetchcomplete", (item) => {
138
this.chunk.push(item.url);
139
+ if (program.max && this.chunk.length >= program.max) {
140
+ this.crawler.emit("complete");
141
+ this.crawler.stop();
142
+ }
143
});
144
145
this.crawler.on("complete", () => {
0 commit comments