Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
a CSS selector engine in JS
branch: master

This branch is 218 commits behind fb55:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
tests
README.md
browser_functions.js
index.js
package.json

README.md

What?

CSSselect is CSS selector engine. It returns a function that tests elements if they match a selector - checking needs to happen "from the top", like browser engines execute queries.

Why?

Just take the following CSS query: foo bar baz. When the element named baz has like a billion children, every one of them needs to be checked if they match a query. Three times, to be precise, if you run a CSS query from the start to the end (as e.g. JSDOM does). Yup, that's slow.

This library checks every element once. The more complex the query, the greater the benefit.

How?

By stacking functions!

TODO

  1. The API needs to be improved
  2. Documentation needs to be written
Something went wrong with that request. Please try again.