# is-html-ts

> Check if a string is HTML

Latest version **1.0.0** (published 2022-07-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-html-ts
pnpm add is-html-ts
yarn add is-html-ts
bun add is-html-ts
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-07-15 |
| First published | 2022-07-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | ^12.20.0 \|\| ^14.13.1 \|\| >=16.0.0 |
| Dependencies | 1 |
| Unpacked size | 8.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ivan Monastyrev |
| Maintainers | ikloster |
| Keywords | html, detect, check, is, tags, elements, string, typescript, ts |

## Links

- npm: https://www.npmjs.com/package/is-html-ts
- Repository: https://github.com/ikloster03/is-html-ts
- Homepage: https://github.com/ikloster03/is-html-ts#readme
- Issues: https://github.com/ikloster03/is-html-ts/issues
- npm.io page: https://npm.io/package/is-html-ts

## Dependencies (1)

- [html-tags](https://npm.io/package/html-tags.md) 3.2.0

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2022-07-15
- 0.1.0 — 2022-07-15

## README

# is-html-ts

> forked from [is-html](https://github.com/sindresorhus/is-html)

> Check if a string is HTML

You should not use this for any kind of validation, sanitation, or XSS checks.

## Install

```
$ npm install is-html-ts
```
```
$ yarn add is-html-ts
```

## Usage

```ts
import isHtml, { basic, full } from 'is-html-ts';
import type { Options } from 'is-html-ts'

isHtml('<p>I am HTML</p>');
//=> true

isHtml('<!doctype><html><body><h1>I ❤ unicorns</h1></body></html>');
//=> true

isHtml('<cake>I am XML</cake>');
//=> false

isHtml('>+++++++>++++++++++>+++>+<<<<-');
//=> false

const customOptions: Options = {
    regExp: 'basic',
    length: 'all',
};

isHtml('<!doctype><html><body><h1>I ❤ unicorns</h1></body></html>', customOptions);
//=> true

isHtml('<cake>I am XML</cake>', customOptions);
//=> false
```

Note: It does not detect deprecated HTML tags.

---
_Source: https://npm.io/package/is-html-ts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
