Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inDemoInstall

postcss-selector-parser

Package Overview
Dependencies
2
Maintainers
4
Versions
51
Issues
File Explorer

Advanced tools

postcss-selector-parser

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

    6.0.11latest
    Github

Version published
Maintainers
4
Weekly downloads
37,304,064
increased by7.87%

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 35,778,403 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 because the last version was released less than a year ago.It has 4 open source maintainers collaborating on the project.

Last updated on 20 Nov 2022

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket[email protected]

Product

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc