You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

selector-parse

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

selector-parse

Selector parser

0.3.2
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Selector Parse

Build Status XO code style npm version

Selector parser

Usage

in Node.js

npm i selector-parse

in browser

<script src="selector-parse.js"></script>

Browser

IE >= 9, *

Example

const selectorParse = require('selector-parse.js');
const selector = `input
                  #name
                  .default.input__text
                  [placeholder=John][required]
                  [data-id=123][data-key=foo]
                  {text}`;
const result = selectorParse(selector);
console.log(result);

output like this

{ tag: 'input',
  id: 'name',
  placeholder: 'John',
  required: true,
  innerText: 'text',
  dataSet: { id: '123', key: 'foo' },
  classList: [ 'default', 'input__text' ],
  className: 'default input__text' }

Keywords

css

FAQs

Package last updated on 25 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