Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yisibl/is-xml
Check if a String/Buffer is XML
https://github.com/yisibl/is-xml
Last synced: 14 days ago
JSON representation
Check if a String/Buffer is XML
- Host: GitHub
- URL: https://github.com/yisibl/is-xml
- Owner: yisibl
- License: mit
- Created: 2015-09-25T09:03:27.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-25T09:18:59.000Z (about 9 years ago)
- Last Synced: 2024-10-22T16:55:47.079Z (22 days ago)
- Language: JavaScript
- Size: 125 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
- License: LICENSE
Awesome Lists containing this project
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('I am XML');
isXML(
'<标题>一丝是谁?标题>' +
'<简介>当你们每天喊我「丝姐」的时候' +
'我深深的沉浸在其中不能自拔简介>'
);
// => true
```### HTML
```js
isXML('');
isXML('');
isXML('');
isXML('');
// => true
```### SVG
```js
isXML('');
isXML('');
// => true
```### Emjio :joy:
```js
isXML('');
');
isXML('');
isXML('
// => true
```### [More test case](test/index.js)
## License
MIT © [yisibl](https://github.com/yisibl/) ([Weibo](http://weibo.com/jieorlin))