Installations
npm install astquery
Developer Guide
Typescript
No
Module System
CommonJS
NPM Version
1.3.24
Score
74.1
Supply Chain
84.2
Quality
74.9
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (99.13%)
Shell (0.87%)
Developer
termi
Download Statistics
Total Downloads
287,184
Last Day
13
Last Week
209
Last Month
1,476
Last Year
18,803
GitHub Statistics
5 Stars
34 Commits
2 Watching
1 Branches
1 Contributors
Package Meta Information
Latest Version
0.0.11
Package Id
astquery@0.0.11
Size
11.30 kB
NPM Version
1.3.24
Publised On
04 Apr 2014
Total Downloads
Cumulative downloads
Total Downloads
287,184
Last day
-80.3%
13
Compared to previous day
Last week
-27.2%
209
Compared to previous week
Last month
-69.6%
1,476
Compared to previous month
Last year
-17.3%
18,803
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
2
ASTQuery
Use css-like selectors for walking over AST-tree
Example
1var ast = esprima.parse('function test(){ var a, b = 0; a = 1; a += 2; b++; b--; };test();'); 2var astQuery = new ASTQuery(ast, 'es5'); 3astQuery.on({ 4 print: function(node, message) { 5 console.log('node type is ' + node.type + ' | ' + message) 6 } 7 8 , ':: FunctionDeclaration': function(node) { 9 this.print(node, '1| '); 10 } 11 12 , ':: VariableDeclarator': function(node) { 13 this.print(node, '2| ' + node.id.name); 14 } 15 16 , ':: AssignmentExpression[operator="="]': function(node) { 17 this.print(node, '3| ' + node.left.name + "|" + node.operator); 18 } 19 20// TODO:: 21// , ':: UpdateExpression[operator="++"]': function(node) { 22// this.print(node, '4| ' + node.argument.name + "|" + node.operator); 23// } 24 25// TODO:: 26// , ':: :other': function(node) { 27// console.log(' untouched node type is ' + node.type); 28// } 29}, {prefix: '::'}); 30 31astQuery.apply(); 32 33// console output is: 34// > node type is FunctionDeclaration | 1| 35// > node type is VariableDeclarator | 2| a 36// > node type is VariableDeclarator | 2| b 37// > node type is AssignmentExpression | 3| a|= 38
TODO
- ':other' pseudo-class
- complex selector's support ('tag>tag')
- classes support with API to adding class description
- es6 'query' string template tag (astQuery.query
VariableDeclarator:${function(node){ return node.id.name == 'a' }}
) - 'removeListener'
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
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
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
3
/10
Last Scanned on 2024-12-16
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