# is-xml

> Check if a string is XML

Latest version **0.1.0** (published 2015-09-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-xml
pnpm add is-xml
yarn add is-xml
bun add is-xml
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2015-09-25 |
| First published | 2015-09-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | yisibl |
| Maintainers | yisi |
| Keywords | xml, detect, check, is, tags, elements, string |

## Links

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

## 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

- 0.1.0 (latest) — 2015-09-25

## README

# is-xml

[![Build Status](https://travis-ci.org/yisibl/is-xml.svg?branch=master)](https://travis-ci.org/yisibl/is-xml)
[![NPM Downloads](https://img.shields.io/npm/dm/is-xml.svg?style=flat)](https://www.npmjs.com/package/is-xml)
[![NPM Version](http://img.shields.io/npm/v/is-xml.svg?style=flat)](https://www.npmjs.com/package/is-xml)
[![License](https://img.shields.io/npm/l/is-xml.svg?style=flat)](http://opensource.org/licenses/MIT)

> Check if a String/Buffer is XML(HTML/XHTML/SVG/MathML/XUL/XBL/RSS)

## Install

```sh
npm install --save is-xml
```

## Usage

```js
var isXML = require('is-xml');
```

### XML

```js
isXML('<message><warning>I am XML</warning></message>');
isXML(
    '<标题>一丝是谁？</标题>' +
    '<简介>当你们每天喊我「丝姐」的时候' +
    '我深深的沉浸在其中不能自拔</简介>'
);
// => true
```

### HTML

```js
isXML('<html>');
isXML('<html></html>');
isXML('<input type="text" />');
isXML('<img src="#" alt="img"/>');
// => true
```

### SVG

```js
isXML('<svg width="100" height="100" viewBox="0 0 30 30" version="1.1"></svg>');
isXML('<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg></svg>');
// => true
```

### Emjio :joy:

```js
isXML('<p class="foo_bar-🙈🔞🙈" id="👻">');
isXML('<p 😂👻😂="foo_bar">');
isXML('<foo😘( ●─● )💓></foo😘( ●─● )💓>');
isXML('<p class="(ོ•̀⌄•́)ོ"></p>');
// => true
```

### [More test case](test/index.js)


## License

MIT © [yisibl](https://github.com/yisibl/) ([Weibo](http://weibo.com/jieorlin))

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