0.4.1 • Published 10 years ago

digger-selector v0.4.1

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

digger-selector

Build status

The CSS selector parser used for digger

installation

$ npm install digger-selector

or in the browser using browserify

example

var Selector = require('digger-selector');

var parsed = Selector('product[price<=100] > caption.big, friend');

parsed would be this data structure:

{
    "string": "product[price<=100] > caption.big, friend",
    "phases": [
        [
            {
                "string": "product[price<=100]",
                "class": {},
                "attr": [
                    {
                        "field": "price",
                        "operator": "<=",
                        "value": "100"
                    }
                ],
                "modifier": {},
                "tag": "product"
            },
            {
                "string": " > caption.big",
                "class": {
                    "big": true
                },
                "attr": [],
                "modifier": {},
                "splitter": ">",
                "tag": "caption"
            }
        ],
        [
            {
                "string": "friend",
                "class": {},
                "attr": [],
                "modifier": {},
                "tag": "friend"
            }
        ]
    ]
}

licence

MIT

0.4.1

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.8

11 years ago

0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago