Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
seo-recommender
Advanced tools
Parse HTML and provide suggestions on SEO. Powered by cheerio.
npm install seo-recommender
There are 5 pre-defined rule groups, used when specifying white list
There 3 rule types according to pre-defined rule groups, used when adding more rules
Provide a list of objects for adding custom rules.
Must be called before calling API run()
.
E.g. Check if <meta name="robots" />
exists or not
var rcmndr = new SEORecommender();
rcmndr.addRules([{
ruleType: RULE_TYPES.TAG_WITHOUT_TAG_WITH_ATTR_AND_VALUE,
tag: 'head',
conditions: {
tag: 'meta',
attr: 'name',
value: 'robots',
},
userDefinedConditions: null,
desc: 'This HTML does not have %s tag',
}]);
Start parsing and recommending.
Provide an options
object.
E.g. run with options:
var rcmndr = new SEORecommender();
rcmndr.run({
inType: INPUT_TYPE.FILE,
inPath: 'test.html',
outType: OUTPUT_TYPE.CONSOLE,
});
Check exmpale
for more information.
const fs = require('fs');
const {
SEORecommender,
INPUT_TYPE,
OUTPUT_TYPE,
PREDEFINED_RULE_GROUPS,
RULE_TYPES,
} = require('seo-recommender');
function inputFileOutputConsole() {
var rcmndr = new SEORecommender();
rcmndr.run({
inType: INPUT_TYPE.FILE,
inPath: 'test.html',
outType: OUTPUT_TYPE.CONSOLE,
});
}
function inputStreamOutputFile() {
var rcmndr = new SEORecommender();
var inStream = fs.createReadStream('test.html');
rcmndr.run({
inType: INPUT_TYPE.STREAM,
inStream: inStream,
outType: OUTPUT_TYPE.FILE,
outPath: 'output',
});
}
function inputStreamOutputStream() {
var rcmndr = new SEORecommender();
var inStream = fs.createReadStream('test.html');
rcmndr.run({
inType: INPUT_TYPE.STREAM,
inStream: inStream,
outType: OUTPUT_TYPE.STREAM,
callback: (writable) => {
console.log('writable =', writable);
},
});
}
function addRules() {
var rcmndr = new SEORecommender();
rcmndr.addRules([{
ruleType: RULE_TYPES.TAG_WITHOUT_TAG_WITH_ATTR_AND_VALUE,
tag: 'head',
conditions: {
tag: 'meta',
attr: 'name',
value: 'robots',
},
userDefinedConditions: null,
desc: 'This HTML does not have %s tag',
}]);
rcmndr.run({
inType: INPUT_TYPE.FILE,
inPath: 'test.html',
outType: OUTPUT_TYPE.CONSOLE,
});
}
function addRulesWhiteList() {
var rcmndr = new SEORecommender();
rcmndr.run({
rulesWhiteList: [PREDEFINED_RULE_GROUPS.IMG_WITHOUT_ALT],
inType: INPUT_TYPE.FILE,
inPath: 'test.html',
outType: OUTPUT_TYPE.CONSOLE,
});
}
inputFileOutputConsole();
//inputStreamOutputFile();
//inputStreamOutputStream();
//addRules();
//addRulesWhiteList();
FAQs
A SEO recommender for HTML files
We found that seo-recommender 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.