1.2.0 • Published 8 years ago
seo-detect v1.2.0
SEO Detect
A Node.js package that scans a HTML file and show all of the SEO defects specified by the user.
Requirements
- Node
- npm
Installation
npm install seo-detectDependencies
Usage
const seoDetect = require('seoDetect');
// specify input, rule and output file paths
seoDetect.getResults({
inputFilePath: 'path/to/input/file',
ruleFilePath: 'path/to/rule/file',
outputFilePath: 'path/to/output/file',
});Setting rules
Three formats are allowed:
<tag_name>exists or<tag_name attribute>exists<tag_name>withoutattribute<tag_name>limitnumber
There are five default rules specified:
1. <img> without alt
2. <a> without rel
3. In <head>:
<title> exists
<meta name="description"> exists
<meta name="keywords"> exists
4. <strong> limit 15
5. <h1> limit 1If you want to add/remove rules, you can either edit the seo-detect/test_files/rule.txt file or specify your own rule file path.
Testing
After cloning the repo and installing the modules, run npm run test with or without arguments.
Use a module like minimist to accept input from the user. An example can be found at test.js
Authors
License
This project is licensed under the MIT License - see the LICENSE file for details