0.0.9 • Published 1 year ago

babylon-query v0.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

babylon-query queries a Babylon AST using a esquery-style syntax to define syntactic filters, and returning @babel/traverse-ready NodePaths.

Try the demonstration here!

Selector types:

  • Type Identifier
  • Wildcard *
  • Negation :not(Identifier, ExpressionStatement)
  • Matches-Any :is(Identifier, ExpressionStatement)
  • Relational :has(> Identifier.id)
  • Ancestry CallStatement.body:is(BlockStatement).body.0
  • Attribute
  • Root path :root
  • :nth-child
    • nth-child(3n+1)
    • first-child
    • last-child
  • Combinators
    • Descendant
    • Child >
    • Next-sibling +
    • Subsequent-sibling ~
0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago