Standalone CSS Selector Parser and Engine. An official MooTools project.
JavaScript
Pull request Compare This branch is 7 commits ahead of mootools:master.
Permalink
Failed to load latest commit information.
.gitignore ignoring files ending with ~, like vims .un~ files Mar 12, 2012
.jshintrc umd wrap Dec 17, 2013
.npmignore parser only Jul 25, 2013
README.md parser only Jul 25, 2013
bower.json umd wrap Dec 17, 2013
index.js exports to slicker not Slick for global Dec 28, 2013
package.json 0.0.2 Dec 17, 2013

README.md

(Slick is an official MooTools project)

Slicker

Just the Slick parser for nodejs

Slick CSS Selector Parser

Parse a CSS selector string into a JavaScript object

Usage

.parse() selector into object

Parse a CSS Selector String into a Selector Object.

Expects: String

Returns: SelectorObject

var slicker = require('slick');

slicker.parse("#foo > bar.baz") → SelectorObject

SelectorObject format

slicker.parse('#foo > bar.baz');
{
	"raw":"#foo > bar.baz",
	"expressions": [[
		{ "combinator":" ", "tag":"*", "id":"foo" },
		{ "combinator":">", "tag":"bar", "classList": ["baz"], "classes": [{"value":"baz", "regexp":RegExp }]}
	]]
}

slicker.parse('h1, h2, ul > li, .things')
{
	"raw": "h1, h2, ul > li, .things",
	"expressions": [
		[{ "combinator":" ", "tag": "h1" }],
		[{ "combinator":" ", "tag": "h2" }],
		[{ "combinator":" ", "tag": "ul" }, { "combinator": ">", "tag": "li" }],
		[{ "combinator":" ", "tag": "*", "classList": ["things"], "classes": [{"value": "things", "regexp":RegExp }] }]
	]
}