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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@j9t/obsohtml

v1.6.2

Published

Find obsolete HTML elements and attributes

Downloads

421

Readme

ObsoHTML, the Obsolete HTML Checker

ObsoHTML is a Node.js script designed to scan HTML, PHP, Nunjucks, Twig, JavaScript, and TypeScript files for obsolete or proprietary HTML attributes and elements (in scripts, it would catch JSX syntax). It helps you identify and update deprecated HTML code to be more sure to use web standards.

Usage

1. As a Node Module

Installation

npm i @j9t/obsohtml

(To install ObsoHTML globally, use the -g flag, as in npm i -g @j9t/obsohtml.)

Execution

The script accepts a folder path as a command line option, which can be specified in both short form (-f) and long form (--folder). The folder path can be either absolute or relative.

The script can be run in “verbose” mode by appending -v or --verbose to the command. This will show information about files and directories that were skipped.

Example Commands

Use the default directory (user home directory):

npx obsohtml

Specify a folder using an absolute path (easiest and most common use case):

npx obsohtml -f /path/to/folder

Specify a folder using a relative path:

npx obsohtml -f ../path/to/folder

2. As a Standalone Script

Installation

Download or fork the source repository.

Execution

As mentioned above, the script accepts a folder (-f, --folder) and can be run in “verbose” mode (-v, --verbose).

Example Commands

(All commands as run from the root directory of the downloaded repository.)

Use the default directory (user home directory):

node bin/obsohtml.js

Specify a folder using an absolute path (easiest and most common use case):

node bin/obsohtml.js -f /path/to/folder

Specify a folder using a relative path:

node bin/obsohtml.js -f ../path/to/folder

Output

The script will output messages to the console indicating any obsolete attributes or elements found in the scanned files, along with the file paths where they were detected.

Background

This started as an experiment, in which I used AI to produce this little HTML quality helper, its tests, and its documentation. While it’s pretty straightforward, I might have missed something. Please file an issue or contact me directly if you spot a problem or have a suggestion.

Acknowledgments

Thanks to @mattbrundage, @FabianBeiner, and @AndrewMac for helping to make ObsoHTML better!