{"id":14981827,"url":"https://github.com/babel/babyquery","last_synced_at":"2025-10-02T23:35:40.891Z","repository":{"id":65983464,"uuid":"269448049","full_name":"babel/babyquery","owner":"babel","description":"ECMAScript AST query library.","archived":false,"fork":true,"pushed_at":"2020-06-04T19:39:53.000Z","size":411,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-14T01:33:18.550Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://estools.github.io/esquery/","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"estools/esquery","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/babel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["babel"],"open_collective":"babel","custom":"https://gitcoin.co/grants/2906/babel-compiler-for-next-generation-javascript"}},"created_at":"2020-06-04T19:32:55.000Z","updated_at":"2024-01-09T06:03:25.000Z","dependencies_parsed_at":"2023-02-19T19:01:24.647Z","dependency_job_id":null,"html_url":"https://github.com/babel/babyquery","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babel%2Fbabyquery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babel%2Fbabyquery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babel%2Fbabyquery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babel%2Fbabyquery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/babel","download_url":"https://codeload.github.com/babel/babyquery/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":218588948,"owners_count":16355663,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T14:04:18.988Z","updated_at":"2025-10-02T23:35:40.487Z","avatar_url":"https://github.com/babel.png","language":"JavaScript","funding_links":["https://github.com/sponsors/babel","https://opencollective.com/babel","https://gitcoin.co/grants/2906/babel-compiler-for-next-generation-javascript"],"categories":[],"sub_categories":[],"readme":"ESQuery is a library for querying the AST output by Esprima for patterns of syntax using a CSS style selector system. Check out the demo:\n\n[demo](https://estools.github.io/esquery/)\n\nThe following selectors are supported:\n* AST node type: `ForStatement`\n* [wildcard](http://dev.w3.org/csswg/selectors4/#universal-selector): `*`\n* [attribute existence](http://dev.w3.org/csswg/selectors4/#attribute-selectors): `[attr]`\n* [attribute value](http://dev.w3.org/csswg/selectors4/#attribute-selectors): `[attr=\"foo\"]` or `[attr=123]`\n* attribute regex: `[attr=/foo.*/]` or (with flags) `[attr=/foo.*/is]`\n* attribute conditions: `[attr!=\"foo\"]`, `[attr\u003e2]`, `[attr\u003c3]`, `[attr\u003e=2]`, or `[attr\u003c=3]`\n* nested attribute: `[attr.level2=\"foo\"]`\n* field: `FunctionDeclaration \u003e Identifier.id`\n* [First](http://dev.w3.org/csswg/selectors4/#the-first-child-pseudo) or [last](http://dev.w3.org/csswg/selectors4/#the-last-child-pseudo) child: `:first-child` or `:last-child`\n* [nth-child](http://dev.w3.org/csswg/selectors4/#the-nth-child-pseudo) (no ax+b support): `:nth-child(2)`\n* [nth-last-child](http://dev.w3.org/csswg/selectors4/#the-nth-last-child-pseudo) (no ax+b support): `:nth-last-child(1)`\n* [descendant](http://dev.w3.org/csswg/selectors4/#descendant-combinators): `ancestor descendant`\n* [child](http://dev.w3.org/csswg/selectors4/#child-combinators): `parent \u003e child`\n* [following sibling](http://dev.w3.org/csswg/selectors4/#general-sibling-combinators): `node ~ sibling`\n* [adjacent sibling](http://dev.w3.org/csswg/selectors4/#adjacent-sibling-combinators): `node + adjacent`\n* [negation](http://dev.w3.org/csswg/selectors4/#negation-pseudo): `:not(ForStatement)`\n* [has](https://drafts.csswg.org/selectors-4/#has-pseudo): `:has(ForStatement)`\n* [matches-any](http://dev.w3.org/csswg/selectors4/#matches): `:matches([attr] \u003e :first-child, :last-child)`\n* [subject indicator](http://dev.w3.org/csswg/selectors4/#subject): `!IfStatement \u003e [name=\"foo\"]`\n* class of AST node: `:statement`, `:expression`, `:declaration`, `:function`, or `:pattern`\n\n[![Build Status](https://travis-ci.org/estools/esquery.png?branch=master)](https://travis-ci.org/estools/esquery)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabel%2Fbabyquery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbabel%2Fbabyquery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabel%2Fbabyquery/lists"}