Big update!Announcing Socket for GitHub 1.0. Learn more
Socket
BlogLoveFAQ
Install
Log in

postcss-selector-parser

Package Overview
Dependencies
2
Maintainers
4
Versions
50
Issues
File Explorer

Advanced tools

postcss-selector-parser

> Selector parser with built in methods for working with selector strings.

    6.0.10latest

Version published
Maintainers
4
Weekly downloads
35,321,965
decreased by-4.23%

Weekly downloads

Readme

Source

postcss-selector-parser Build Status

Selector parser with built in methods for working with selector strings.

Install

With npm do:

npm install postcss-selector-parser

Quick Start

const parser = require('postcss-selector-parser'); const transform = selectors => { selectors.walk(selector => { // do something with the selector console.log(String(selector)) }); }; const transformed = parser(transform).processSync('h1, h2, h3');

To normalize selector whitespace:

const parser = require('postcss-selector-parser'); const normalized = parser().processSync('h1, h2, h3', {lossless: false}); // -> h1,h2,h3

Async support is provided through parser.process and will resolve a Promise with the resulting selector string.

API

Please see API.md.

Credits

  • Huge thanks to Andrey Sitnik (@ai) for work on PostCSS which helped accelerate this module's development.

License

MIT

FAQs

What is postcss-selector-parser?

> Selector parser with built in methods for working with selector strings.

Is postcss-selector-parser popular?

The npm package postcss-selector-parser receives a total of 28,262,843 weekly downloads. As such, postcss-selector-parser popularity was classified as popular.

Is postcss-selector-parser well maintained?

We found that postcss-selector-parser demonstrated a healthy version release cadence and project activity. It has 4 open source maintainers collaborating on the project.

Last updated on 30 Mar 2022
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc