Big News: Socket Selected for OpenAI's Cybersecurity Grant Program.Details
Socket
Book a DemoSign in
Socket

obsohtml

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

obsohtml

HTML checker for obsolete and proprietary elements and attributes

latest
Source
npmnpm
Version
1.10.0
Version published
Weekly downloads
179
842.11%
Maintainers
1
Weekly downloads
 
Created
Source

ObsoHTML, the Obsolete HTML Checker

npm version Build status Socket

ObsoHTML is a Node.js tool designed to scan HTML, PHP, Nunjucks, Twig, JavaScript, and TypeScript files for obsolete and proprietary HTML elements and attributes. It helps you identify and update deprecated HTML code to be sure to use web standards.

ObsoHTML has inherent limitations and may not find all obsolete elements and attributes. If you run into a problem, please file an issue.

Usage

1. Via CLI

Installation

npm i obsohtml

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

To use ObsoHTML without installing, run it via npx obsohtml. To use it as a standalone script, download or fork the source repository and run node bin/obsohtml.js directly—the same options apply.

Execution

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

ObsoHTML 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. Programmatic API

ObsoHTML can be imported as a module to check HTML strings in your own tooling:

import { checkMarkup, obsoleteElements, obsoleteAttributes } from 'obsohtml';

const { elements, attributes } = checkMarkup('<center>Hello</center>');
// elements: ['center']
// attributes: []

checkMarkup(html)

Checks an HTML string for obsolete or proprietary elements and attributes.

  • Parameter: html (string)—the HTML content to check
  • Returns: { elements: string[], attributes: string[] }—arrays of found obsolete element and attribute names

obsoleteElements

Array of obsolete or proprietary HTML element names checked by ObsoHTML.

obsoleteAttributes

Array of obsolete or proprietary HTML attribute names checked by ObsoHTML.

Output

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

The script exits with code 1 if any obsolete HTML is found, and 0 if none is found, making it suitable for use in CI pipelines.

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’m sure to 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!

Keywords

html

FAQs

Package last updated on 11 Apr 2026

Did you know?

Socket

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.

Install

Related posts