Socket
Socket
Sign inDemoInstall

is-html

Package Overview
Dependencies
1
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    is-html

Check if a string is HTML


Version published
Maintainers
1
Install size
6.46 kB
Created

Readme

Source

is-html Build Status

Check if a string is HTML

Install

Download manually or with a package-manager.

npm
npm install --save is-html
Bower
bower install --save is-html
Component
component install sindresorhus/is-html

Example

Node.js
var isHtml = require('is-html');
Bower
<script src="bower_components/is-html/is-html.js"></script>
Usage
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

License

MIT © Sindre Sorhus

Keywords

FAQs

Last updated on 13 Dec 2013

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc