
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
seo-html-defect-checker
Advanced tools
Lightweight module for checking SEO HTML defect elements.
Lightweight module for checking SEO HTML defect elements.
Built for
This is node.js libarary. Install nodejs first, then:
npm install seo-html-defect-checker
or
yarn add seo-html-defect-checker
There are 7 defined rules that you can use to validate HTML.
<img />
tags without alt attribute<a />
tags without rel attribute<title>
tag<meta name=“descriptions” … />
tag<meta name=“keywords” … />
tag<strong>
tag in HTML (15 is a value should be configurable by user)<H1>
tag.Rules object as follows:
Rules = {
definedRules : {
aTagWithoutRel,
imgTagWithoutAlt,
dontHaveTitle,
dontHaveMetaDescription,
dontHaveMetaKeywords,
moreThan15StrongTag,
moreThan1H1Tag,
}
}
For example:
const {Checker, Rules} = require('seo-html-defect-checker')
const c = new Checker(htmlText)
c.check([Rules.definedRules.aTagWithoutRel], (results) => {
// manipulate results
})
There is a defined rule list that include 7 rules as follows example:
const {Checker, Rules} = require('seo-html-defect-checker')
const htmlText = loadHtmlFunction() // function return string
const c = new Checker(htmlText)
c.check(Rules.definedRules.defaultRuleList, (results) => { // results is array
// manipulate results
})
And you can customize the rules list such as
const {Checker, Rules} = require('seo-html-defect-checker')
const htmlText = loadHtmlFunction() // function return string
const c = new Checker(htmlText)
const myRules = [
Rules.definedRules.aTagWithoutRel,
Rules.definedRules.dontHaveMetaDescription
]
c.check(myRules, results => {
console.log(results)
})
Beside that you can customize the rule throw 4 objects:
Rules = {
//....
MissAttributeRule, // check tags that don't have some specific attributes
MissTagRule, // check HTML without tags which have some specific attributes (or only just tags)
MoreTagThanRule, // check there is more than a specific number of tags which occur in HTML
CustomRule, // custom whatever rule you want
}
Examples:
const {MissAttributeRule, MissTag, MoreTagThan} = Rules
const r1 = new MissAttributeRule('img', {
alt: null,
})
const r2 = new MissTag('title', {}, 'head >')
const r3 = new MoreTagThan('strong', {}, null, 5)
const rules = [r1, r2, r3]
const c = new Checker(htmlText)
c.check(rules, results => {
// manipulate results
})
const {CustomRule} = Rules
const r4 = new CustomRule('meta', {
'keywords*': 'shopping'
}, 'head >', (dom, selector) => {
var num = dom.count(selector)
if (num == 0) {
return 'miss shopping keyword'
}
return null
})
const c = new Checker(htmlText)
c.check([r4], results => {
// manipulate results
})
And you can customize your selector query
const r5 = new CustomRule('p', {}, null, (dom, selector) => {
var num = dom.count('p.highlight:not(.warning)')
if (num == 0) {
return `there are ${num} p tags with hightlight class and without warning class`
}
return null
})
const c = new Checker(htmlText)
c.check([r4], results => {
// manipulate results
})
Let people know how they can contribute into your project.
A short snippet describing the license (MIT, Apache etc)
MIT © DoHa
FAQs
Lightweight module for checking SEO HTML defect elements.
The npm package seo-html-defect-checker receives a total of 4 weekly downloads. As such, seo-html-defect-checker popularity was classified as not popular.
We found that seo-html-defect-checker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.