-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
41 lines (41 loc) · 2.57 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
{
"name": "detective",
"description": "find all require() calls by walking the AST",
"version": "4.0.0",
"repository": {
"type": "git",
"url": "git://github.com/substack/node-detective.git"
},
"main": "index.js",
"keywords": [
"require",
"source",
"analyze",
"ast"
],
"scripts": {
"test": "tap test/*.js"
},
"dependencies": {
"acorn": "~0.9.0",
"defined": "0.0.0",
"escodegen": "^1.4.1"
},
"devDependencies": {
"tap": "~0.4.0"
},
"license": "MIT",
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
"url": "http://substack.net"
},
"readme": "# detective\n\nfind all calls to `require()` by walking the AST\n\n[![build status](https://secure.travis-ci.org/substack/node-detective.png)](http://travis-ci.org/substack/node-detective)\n\n# example\n\n## strings\n\nstrings_src.js:\n\n``` js\nvar a = require('a');\nvar b = require('b');\nvar c = require('c');\n```\n\nstrings.js:\n\n``` js\nvar detective = require('detective');\nvar fs = require('fs');\n\nvar src = fs.readFileSync(__dirname + '/strings_src.js');\nvar requires = detective(src);\nconsole.dir(requires);\n```\n\noutput:\n\n```\n$ node examples/strings.js\n[ 'a', 'b', 'c' ]\n```\n\n# methods\n\n``` js\nvar detective = require('detective');\n```\n\n## detective(src, opts)\n\nGive some source body `src`, return an array of all the `require()` calls with\nstring arguments.\n\nThe options parameter `opts` is passed along to `detective.find()`.\n\n## var found = detective.find(src, opts)\n\nGive some source body `src`, return `found` with:\n\n* `found.strings` - an array of each string found in a `require()`\n* `found.expressions` - an array of each stringified expression found in a\n`require()` call\n* `found.nodes` (when `opts.nodes === true`) - an array of AST nodes for each\nargument found in a `require()` call\n\nOptionally:\n\n* `opts.word` - specify a different function name instead of `\"require\"`\n* `opts.nodes` - when `true`, populate `found.nodes`\n* `opts.isRequire(node)` - a function returning whether an AST node is a require\ncall\n* `opts.parse` - supply options directly to\n[acorn](https://npmjs.org/package/acorn) with some support for esprima-style\noptions `range` and `loc`\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install detective\n```\n\n# license\n\nMIT\n",
"readmeFilename": "readme.markdown",
"bugs": {
"url": "https://github.com/substack/node-detective/issues"
},
"homepage": "https://github.com/substack/node-detective",
"_id": "detective@4.0.0",
"_from": "detective@^4.0.0"
}