
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
scan-html-file
Advanced tools
Developing a Node.js package to let a user use this package to scan a HTML file and show all of the SEO defects.
Developing a Node.js package to let a user use this package to scan a HTML file and show all of the SEO defects.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Install Scanning HTML file SEO defects globally using npm: 'npm install --save scanning-html-file'
To get familiar with usage of the module: 'node index.js'
Output should be printed to terminal like below:
Show all of the SEO defects
Finish all SEO defects scan
All <img> in this HTML file contain attribute "alt".
This HTML file contains 30 <a> tag without rel attribute.
This HTML file does not have a <meta name="description" .../> tag
This HTML file does not have a <meta name="keywords" .../> tag
This HTML has less than 15, <strong> tag. Count = 0
This HTML has less than 1, <h1> tag. Count = 0
The input can be either: I. A HTML file (User is able to config the input path) II. Node Readable Stream
The output can be either: I. A file (User is able to config the output destination) II. Node Writable Stream III. Console
/**
* Setup The input is A HTML file from the path
* @param {object} input - used to feed in HTML file source
*/
scanningHTMLFile.setInput(new Input().createInputFile(__dirname+"/test/Node.js.html"));
/**
* Setup the input is A Node Readable Stream
* @param {object} input - used to feed in HTML file source
*/
var readable_stream = fs.createReadStream(__dirname+"/test/Node.js.html");
scanningHTMLFile.setInput(new Input().createInputStream(readable_stream));
/**
* Setup the output is console
* @param {object} output - console
*/
scanningHTMLFile.setOutput(new Output().createOutputConsole());
/**
* Setup the output is a file
* @param {object} output - used to feed in HTML file source
*/
scanningHTMLFile.setOutput(new Output().createOutputFile(__dirname+"/output.txt"));
/**
* Setup the output is A Node Readable Stream
* @param {object} output - used to feed in HTML file source
*/
var writeable_stream = fs.createWriteStream(__dirname + '/outstream.txt')
scanningHTMLFile.setOutput(new Output().createOutputStream(writeable_stream));
var rules = {
img: 'alt', // if there are any <img />tags without alt attribute
a: 'rel', // if there are any <a />tags without rel attribute
head: {
title: true, // if there is any header that doesn’t have <title>tag
meta: ["description", "robots", "keywords"], // If you want to implement additional rule for meta tag, you just need to add a new tag to array.
},
strong: 15, // there are more than 15 <strong>tag in HTML
h1: 1, // if a HTML have more than one <H1>tag
};
#License
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Developing a Node.js package to let a user use this package to scan a HTML file and show all of the SEO defects.
We found that scan-html-file 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.