Gathering detailed insights and metrics for acorn-globals
Gathering detailed insights and metrics for acorn-globals
Gathering detailed insights and metrics for acorn-globals
Gathering detailed insights and metrics for acorn-globals
Use acorn to detect global variables in JavaScript
npm install acorn-globals
Module System
Unable to determine the module system for this package.
Min. Node Version
Typescript Support
Node Version
NPM Version
45 Stars
84 Commits
26 Forks
5 Watching
1 Branches
9 Contributors
Updated on 10 May 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-8.8%
4,117,565
Compared to previous day
Last week
2.6%
24,886,004
Compared to previous week
Last month
26.7%
95,687,553
Compared to previous month
Last year
-3.5%
930,285,717
Compared to previous year
2
1
Detect global variables in JavaScript using acorn
Get supported acorn-globals with the Tidelift Subscription
npm install acorn-globals
detect.js
1var fs = require('fs'); 2var detect = require('acorn-globals'); 3 4var src = fs.readFileSync(__dirname + '/input.js', 'utf8'); 5 6var scope = detect(src); 7console.dir(scope);
input.js
1var x = 5; 2var y = 3, z = 2; 3 4w.foo(); 5w = 2; 6 7RAWR=444; 8RAWR.foo(); 9 10BLARG=3; 11 12foo(function () { 13 var BAR = 3; 14 process.nextTick(function (ZZZZZZZZZZZZ) { 15 console.log('beep boop'); 16 var xyz = 4; 17 x += 10; 18 x.zzzzzz; 19 ZZZ=6; 20 }); 21 function doom () { 22 } 23 ZZZ.foo(); 24 25}); 26 27console.log(xyz);
output:
$ node example/detect.js
[ { name: 'BLARG', nodes: [ [Object] ] },
{ name: 'RAWR', nodes: [ [Object], [Object] ] },
{ name: 'ZZZ', nodes: [ [Object], [Object] ] },
{ name: 'console', nodes: [ [Object], [Object] ] },
{ name: 'foo', nodes: [ [Object] ] },
{ name: 'process', nodes: [ [Object] ] },
{ name: 'w', nodes: [ [Object], [Object] ] },
{ name: 'xyz', nodes: [ [Object] ] } ]
To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.
MIT
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 10/29 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
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