Socket
Socket
Sign inDemoInstall

extract-html-class

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extract-html-class

Extract all classes from html


Version published
Weekly downloads
8
decreased by-27.27%
Maintainers
1
Weekly downloads
 
Created
Source

extract-html-class stability

npm version build status downloads js-standard-style

Extract all classes from html

Usage

var extract = require('extract-html-class')
var assert = require('assert')

var html = `
  <div class="foo bar">
    <p class="bin baz">hello planet</p>
  </div>
`
var expected = [ 'foo', 'bar', 'bin', 'baz' ]
assert.deepEqual(extract(html), expected, 'array was same')

API

classes = extract(html)

Get an array of classes for the given string. Uses a regex so safe to run on non-html strings too. Returns an empty array if no matches are found.

License

MIT

Keywords

FAQs

Package last updated on 09 Jul 2017

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc