-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
62 lines (62 loc) · 3.26 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
"name": "lexical-scope",
"version": "1.1.0",
"description": "detect global and local lexical identifiers from javascript source code",
"main": "index.js",
"dependencies": {
"astw": "~1.1.0"
},
"devDependencies": {
"tape": "~2.4.1",
"brfs": "~0.0.3"
},
"scripts": {
"test": "tape test/*.js"
},
"testling": {
"files": "test/*.js",
"browsers": [
"ie/6",
"ie/7",
"ie/8",
"ie/9",
"ie/10",
"chrome/20",
"chrome/latest",
"firefox/10",
"firefox/15",
"firefox/latest",
"safari/latest",
"opera/11.0",
"opera/latest"
]
},
"repository": {
"type": "git",
"url": "git://github.com/substack/lexical-scope.git"
},
"homepage": "https://github.com/substack/lexical-scope",
"keywords": [
"ast",
"variable",
"name",
"lexical",
"local",
"global",
"implicit",
"exported"
],
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
"url": "http://substack.net"
},
"license": "MIT",
"readme": "# lexical-scope\n\ndetect global and local lexical identifiers from javascript source code\n\n[![browser support](http://ci.testling.com/substack/lexical-scope.png)](http://ci.testling.com/substack/lexical-scope)\n\n[![build status](https://secure.travis-ci.org/substack/lexical-scope.png)](http://travis-ci.org/substack/lexical-scope)\n\n# example\n\n``` js\nvar detect = require('lexical-scope');\nvar fs = require('fs');\nvar src = fs.readFileSync(__dirname + '/src.js');\n\nvar scope = detect(src);\nconsole.dir(scope);\n```\n\ninput:\n\n```\nvar x = 5;\nvar y = 3, z = 2;\n\nw.foo();\nw = 2;\n\nRAWR=444;\nRAWR.foo();\n\nBLARG=3;\n\nfoo(function () {\n var BAR = 3;\n process.nextTick(function (ZZZZZZZZZZZZ) {\n console.log('beep boop');\n var xyz = 4;\n x += 10;\n x.zzzzzz;\n ZZZ=6;\n });\n function doom () {\n }\n ZZZ.foo();\n\n});\n\nconsole.log(xyz);\n```\n\noutput:\n\n```\n$ node example/detect.js\n{ locals: \n { '': [ 'x', 'y', 'z' ],\n 'body.7.arguments.0': [ 'BAR', 'doom' ],\n 'body.7.arguments.0.body.1.arguments.0': [ 'xyz' ],\n 'body.7.arguments.0.body.2': [] },\n globals: \n { implicit: [ 'w', 'foo', 'process', 'console', 'xyz' ],\n exported: [ 'w', 'RAWR', 'BLARG', 'ZZZ' ] } }\n```\n\n# live demo\n\nIf you are using a modern browser, you can go to http://lexical-scope.forbeslindesay.co.uk/ for a live demo.\n\n# methods\n\n``` js\nvar detect = require('lexical-scope')\n```\n\n## var scope = detect(src)\n\nReturn a `scope` structure from a javascript source string `src`.\n\n`scope.locals` maps scope name keys to an array of local variable names declared\nwith `var`. The key name `''` refers to the top-level scope.\n\n`scope.globals.implicit` contains the global variable names that are expected to\nalready exist in the environment by the script.\n\n`scope.globals.explicit` contains the global variable names that are exported by\nthe script.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install lexical-scope\n```\n\n# license\n\nMIT\n",
"readmeFilename": "readme.markdown",
"bugs": {
"url": "https://github.com/substack/lexical-scope/issues"
},
"_id": "lexical-scope@1.1.0",
"_from": "lexical-scope@~1.1.0"
}