Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A query engine for Grasp - use JavaScript code examples with wildcards
LiveScript Makefile
branch: master

0.2.3

latest commit 4dacca9d52
@gkz authored
Failed to load latest commit information.
lib 0.2.3
src 0.2.3
test string literal quotes now interchangeable
.gitignore update gitignore with fixed rule
.travis.yml update .travis.yml
LICENSE initial
Makefile use mkdir -p in makefile
README.md add build status image to readme
package.json 0.2.3
package.json.ls 0.2.3

README.md

grasp equery Build Status

A query engine for grasp - use JavaScript code examples with wildcards.

For documentation on the selector format, see the grasp page on equery.

See also the other query engine for grasp: squery.

Usage

Add grasp-equery to your package.json, and then require it: var equery = require('grasp-equery);.

The squery object exposes four properties: three functions, parse, queryParsed, query, and the version string as VERSION.

Use parse(selector) to parse a string selector into a parsed selector.

Use queryParsed(parsedSelector, ast) to query your parsed selector.

query(selector, ast) is shorthand for doing queryParsed(parse(selector), ast).

The AST must be in the Mozilla SpiderMonkey AST format - you can use acorn to parse a JavaScript file into the format.

If you are using one selector for multiple ASTs, parse it first, and then feed the parsed version to queryParsed. If you are only using the selector once, just use query.

Something went wrong with that request. Please try again.