npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

scanning-html-file

v1.0.0

Published

Developing a Node.js package to let a user use this package to scan a HTML file and show all of the SEO defects.

Readme

ScanningHTMLFile

Developing a Node.js package to let a user use this package to scan a HTML file and show all of the SEO defects.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Installation

Install Scanning HTML file SEO defects globally using npm: npm install --save scanning-html-file

Example

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 in this HTML file contain attribute "alt". This HTML file contains 30 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, tag. Count = 0 This HTML has less than 1, tag. Count = 0

Usage

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

Basic usage

  1. Input file: /**
  • 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 output is console
  • @param {object} output - console */ scanningHTMLFile.setOutput(new Output().createOutputConsole());
  1. Input readable stream: /**
  • 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));
  1. Output to console: /**
  • Setup the output is console
  • @param {object} output - console */ scanningHTMLFile.setOutput(new Output().createOutputConsole());
  1. Output to a file: /**
  • Setup the output is a file
  • @param {object} output - used to feed in HTML file source */ scanningHTMLFile.setOutput(new Output().createOutputFile(__dirname+"/output.txt"));
  1. Output to readable stream: /**
  • 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));
  1. Pre-defined SEO rules: var rules = { img: 'alt', // if there are any tags without alt attribute a: 'rel', // if there are any tags without rel attribute head: { title: true, // if there is any header that doesn’t have 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 tag in HTML h1: 1, // if a HTML have more than one tag };

#License This project is licensed under the MIT License - see the LICENSE file for details.