Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

parse-sel

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-sel

Parse hyperscript selector strings

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6.1K
increased by14.47%
Maintainers
1
Weekly downloads
 
Created
Source

parse-sel

A "parse selector" kind of utility function.

Install

With npm do:

npm install parse-sel --save

Usage

This module exports a function that takes a string with a hyperscript selector and returns an object.

const parseSelector = require('parse-sel')

parseSelector('div#foo.bar')
// =>
// {
//   tagName: 'div',
//   id: 'foo',
//   className: 'bar'
// }
  

You can pass true as a second argument and get the tagName uppercase.

Credits

This is mainly lifted from the virtual-dom module. https://github.com/Matt-Esch/virtual-dom/blob/master/virtual-hyperscript/parse-tag.js

There's also quite a few packages like this on npm.

License

MIT

Keywords

FAQs

Package last updated on 07 Jun 2016

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