1.0.4 • Published 5 years ago

@reginleiff/seo-defect-checker v1.0.4

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

SEO Defect Checker

Detect Search Engine Optimisation (SEO) defects within HTML code.

Installation

$ npm i @reginleiff/seo-defect-checker

Usage

Using it as a CLI Tool

  • -i - Input file path for html file
  • -r - Rule set export (see lib/sample-rules.js as an example)
  • -o - Output file path (optional - console will be used otherwise)
$ seocheck -i examples/sample.html -r ./lib/sample-rules.js -o ./examples/sample-out.txt

Using the check API

import { check, PredefinedRules } from '@reginleiff/seo-defect-checker';

await check('./test.html', [
  PredefinedRules.ReportNumberImgTagsWithoutRelAttribute,
  PredefinedRules.HeaderShouldContainsTitle,
  PredefinedRules.ReportIfNotMoreThan15Strong
], console);

Creating your own rules

// rules.js
import { ParentContainsTagRule } from '@reginleiff/seo-defect-checker';

const ShouldContainMetaNameRobots = new ParentContainsTagRule('meta', ['name'], ['robots']);

export default {
  ShouldContainMetaNameRobots
}
1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago