For documentation on the selector format, see the grasp page on squery.
See also the other query engine for grasp: equery.
Initially derived from esquery.
grasp-squery to your
package.json, and then require it:
var squery = require('grasp-squery);.
squery object exposes five properties: three functions,
query, a constructor,
Cache, and the version string as
parse(selector) to parse a string selector into a parsed selector.
queryParsed(parsedSelector, ast) to query your parsed selector.
query(selector, ast) is shorthand for doing
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 take an optional third parameter
cache. A cache is automatically created from the AST you supply if you do not supply a cache. You can create your own cache by calling the
Cache constructor with your AST.