seo-rule-checker
v1.0.4
Published
Scan a HTML file and show all of the SEO defects.
Downloads
1
Readme
seo-rule-checker
Scan a HTML file and show all of the SEO defects.
Installation
npm i seo-rule-checker
Usage
Include RuleChecker and other rule checker module.
RuleChecker, aTagRule, h1TagRule, headTagRule, imgTagRule, strongTagRule
Create a new RuleChecker, then call addRule() method to add-on the seo rule. You can also chain others rule together and no order limit.
Const ruleChecker = new RuleChecker(); ruleChecker.addRule(new aTagRule()) .addRule(new h1TagRule()) .addRule( ... new Rule... )
Before you invoke check() method, you need to determine the input source. And after check() you also need to invoke output destination.
ruleChecker.addRule(rule1) .addRule(rule2) ... .readFrom...() .check() .outputTo...();
Support input:
1. readFromFile('file_path') 2. readFromStream(readable_stream)
Support output:
1. outputToFile('file_path') 2. outputToConsole() 3. outputToFileStream()
Easy to extend other rules
You can follow up the structure of other rule class and invoke another addRule(... your rule...)
to RuleChecker.
Limit
Before using ,the HTML file need to be unminifiy.