webcheck-follow
v1.0.0
Published
A plugin for webcheck to follow resources automatically
Downloads
7
Readme
webcheck-follow
Webcheck plugin to follow resources from HTML and CSS resources
How to install
npm install --save webcheck-follow
How to use
var Webcheck = require('webcheck');
var FollowPlugin = require('webcheck-follow');
var plugin = FollowPlugin();
var webcheck = new Webcheck();
webcheck.addPlugin(plugin);
plugin.enable();
// now continue with your code...
Options
filterContentType
: Follow only in matching content-type.filterStatusCode
: Follow only in matching HTTP status code (defaults to 2xx status codes).filterUrl
: Follow only in matching url.filterFollowUrl
: Follow only matching url.
Note for filters
Filters are regular expressions, but the plugin uses only the .test(str)
method to proof. You are able to write
your own and much complexer functions by writing the logic in the test method of an object like this:
opts = {
filterSomething: {
test: function (val) {
return false || true;
}
}
}