kowshik-sundararajan / seo-detect

A npm package that scans a HTML file and shows all of the SEO defects specified by the user.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SEO Detect

A Node.js package that scans a HTML file and shows all of the SEO defects specified by the user.

Requirements

  • Node
  • npm

Installation

npm install seo-detect

Dependencies

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> without attribute
  • <tag_name> limit number

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 1

If 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

Kowshik Sundararajan

License

This project is licensed under the MIT License - see the LICENSE file for details

About

A npm package that scans a HTML file and shows all of the SEO defects specified by the user.

License:GNU General Public License v3.0


Languages

Language:HTML 99.3%Language:JavaScript 0.7%