{ "name": "detective", "description": "Find all calls to require() no matter how crazily nested using a proper walk of the AST", "version": "0.2.1", "repository": { "type": "git", "url": "git://github.com/substack/node-detective.git" }, "main": "index.js", "keywords": [ "require", "source", "analyze", "ast" ], "directories": { "lib": ".", "example": "example", "test": "test" }, "scripts": { "test": "tap test/*.js" }, "dependencies": { "esprima": "~0.9.9" }, "devDependencies": { "tap": "~0.2.6" }, "engines": { "node": ">=0.6.0" }, "license": "MIT", "author": { "name": "James Halliday", "email": "mail@substack.net", "url": "http://substack.net" }, "readme": "detective\n=========\n\nFind all calls to require() no matter how crazily nested using a proper walk of\nthe AST.\n\n[![build status](https://secure.travis-ci.org/substack/node-detective.png)](http://travis-ci.org/substack/node-detective)\n\nexample\n=======\n\nstrings\n-------\n\nstrings_src.js:\n\n````javascript\nvar a = require('a');\nvar b = require('b');\nvar c = require('c');\n````\n\nstrings.js:\n\n````javascript\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 $ node examples/strings.js\n [ 'a', 'b', 'c' ]\n\nmethods\n=======\n\nvar detective = require('detective');\n\ndetective(src, opts)\n--------------------\n\nGive some source body `src`, return an array of all the require()s with string\narguments.\n\nThe options parameter `opts` is passed along to `detective.find()`.\n\ndetective.find(src, opts)\n-------------------------\n\nGive some source body `src`, return an object with \"strings\" and \"expressions\"\narrays for each of the require() calls.\n\nThe \"expressions\" array will contain the stringified expressions.\n\nOptionally you can specify a different function besides `\"require\"` to analyze\nwith `opts.word`.\n\ninstallation\n============\n\n npm install detective\n", "readmeFilename": "README.markdown", "_id": "detective@0.2.1", "_from": "detective@~0.2.0" }