mirror of
https://github.com/azure/login.git
synced 2026-06-07 19:47:09 +00:00
* Bump lodash from 4.17.15 to 4.17.19 (#52) Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Amruta Kawade <65217380+AmrutaKawade@users.noreply.github.com> * Bump @actions/core from 1.1.3 to 1.2.6 (#60) Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.1.3 to 1.2.6. - [Release notes](https://github.com/actions/toolkit/releases) - [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md) - [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Amruta Kawade <65217380+AmrutaKawade@users.noreply.github.com> * updating node_nodules * updated package-lock Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
81 lines
1.8 KiB
Markdown
81 lines
1.8 KiB
Markdown
# acorn-globals
|
|
|
|
Detect global variables in JavaScript using acorn
|
|
|
|
[Get supported acorn-globals with the Tidelift Subscription](https://tidelift.com/subscription/pkg/npm-acorn_globals?utm_source=npm-acorn-globals&utm_medium=referral&utm_campaign=readme)
|
|
|
|
[](https://travis-ci.org/ForbesLindesay/acorn-globals)
|
|
[](https://david-dm.org/ForbesLindesay/acorn-globals)
|
|
[](https://www.npmjs.org/package/acorn-globals)
|
|
|
|
## Installation
|
|
|
|
npm install acorn-globals
|
|
|
|
## Usage
|
|
|
|
detect.js
|
|
|
|
```js
|
|
var fs = require('fs');
|
|
var detect = require('acorn-globals');
|
|
|
|
var src = fs.readFileSync(__dirname + '/input.js', 'utf8');
|
|
|
|
var scope = detect(src);
|
|
console.dir(scope);
|
|
```
|
|
|
|
input.js
|
|
|
|
```js
|
|
var x = 5;
|
|
var y = 3, z = 2;
|
|
|
|
w.foo();
|
|
w = 2;
|
|
|
|
RAWR=444;
|
|
RAWR.foo();
|
|
|
|
BLARG=3;
|
|
|
|
foo(function () {
|
|
var BAR = 3;
|
|
process.nextTick(function (ZZZZZZZZZZZZ) {
|
|
console.log('beep boop');
|
|
var xyz = 4;
|
|
x += 10;
|
|
x.zzzzzz;
|
|
ZZZ=6;
|
|
});
|
|
function doom () {
|
|
}
|
|
ZZZ.foo();
|
|
|
|
});
|
|
|
|
console.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] ] } ]
|
|
```
|
|
|
|
## Security contact information
|
|
|
|
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
|
|
|
|
## License
|
|
|
|
MIT
|