javascript-idents
javascript-idents walks a JS abstract syntax tree (AST) and returns all identifiers the code uses.
It relies on Marijn Haverbeke's Acorn for AST walking, and should work with any ESTree-compliant JavaScript AST.
Example
The following example prints the name of each Identifier
node to the console.
const acorn = ;const idents = ; acorn; idents;
identifier found: a
identifier found: d
identifier found: c
identifier found: z
identifier found: f
identifier found: w
identifier found: x
identifier found: y
Running tests
Run npm test
.
Contributors
- Quinn Slack sqs@sourcegraph.com
- Jannis R mail@jannisr.de