Gathering detailed insights and metrics for @timeax/estree-walker
Gathering detailed insights and metrics for @timeax/estree-walker
Gathering detailed insights and metrics for @timeax/estree-walker
Gathering detailed insights and metrics for @timeax/estree-walker
npm install @timeax/estree-walker
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
970
Last Day
1
Last Week
3
Last Month
18
Last Year
191
397 Stars
112 Commits
38 Forks
5 Watching
1 Branches
14 Contributors
Minified
Minified + Gzipped
Latest Version
3.0.1
Package Id
@timeax/estree-walker@3.0.1
Unpacked Size
23.90 kB
Size
4.91 kB
File Count
12
NPM Version
6.14.15
Node Version
14.17.6
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
0%
3
Compared to previous week
Last month
500%
18
Compared to previous month
Last year
-68.7%
191
Compared to previous year
3
Simple utility for walking an ESTree-compliant AST, such as one generated by acorn. Commonsjs version.
1npm i estree-walker
1var walk = require('estree-walker').walk; 2var acorn = require('acorn'); 3 4ast = acorn.parse(sourceCode, options); // https://github.com/acornjs/acorn 5 6walk(ast, { 7 enter(node, parent, prop, index) { 8 // some code happens 9 }, 10 leave(node, parent, prop, index) { 11 // some code happens 12 } 13});
Inside the enter
function, calling this.skip()
will prevent the node's children being walked, or the leave
function (which is optional) being called.
Call this.replace(new_node)
in either enter
or leave
to replace the current node with a new one.
Call this.remove()
in either enter
or leave
to remove the current node.
The ESTree spec is evolving to accommodate ES6/7. I've had a couple of experiences where estraverse was unable to handle an AST generated by recent versions of acorn, because it hard-codes visitor keys.
estree-walker, by contrast, simply enumerates a node's properties to find child nodes (and child lists of nodes), and is therefore resistant to spec changes. It's also much smaller. (The performance, if you're wondering, is basically identical.)
None of which should be taken as criticism of estraverse, which has more features and has been battle-tested in many more situations, and for which I'm very grateful.
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 4/20 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More