1.0.0 • Published 7 years ago

yoda-seo-tips v1.0.0

Weekly downloads
4
License
ISC
Repository
github
Last release
7 years ago

Yoda SEO Tips

Get tips about SEO for your html code from Grand Master Yoda.

npm.io

<title> tag this document should have
16 <strong> tags I count. More than 15 should be not.

Basic use:

import validate from "yoda-seo-tips"
validate('empty.html')

With settings:

validate('sample2.html', null, {maxStrongTags: 2})

Custom rules:

import {mustHaveElement, imgMustHaveAlt} from "yoda-seo-tips"
validate('sample1.html', null, [
    imgMustHaveAlt,
    mustHaveElement('article', () => '<article> is required'),
    ($, report) => {
        if($('title').text() == '') {
            report('Title should not be empty');
        }
    }
])

See src/rules.ts and src/yodaWisdom.ts for more samples on rule definitions.

1.0.0

7 years ago