{"name":"sleuth","description":"Discover the variable names chosen for each of a file's top-level required modules","version":"0.1.0","main":"index.js","browser":"index.js","dependencies":{"is-require":"0.0.0","static-eval":"~0.1.0"},"devDependencies":{"esprima":"~1.0.4","tape":"~2.4.2"},"scripts":{"test":"node test"},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughsk.io/"},"license":"MIT","repository":{"type":"git","url":"git://github.com/hughsk/sleuth"},"bugs":{"url":"https://github.com/hughsk/sleuth/issues"},"homepage":"https://github.com/hughsk/sleuth","keywords":["analyse","discover","detect","detective","require","ast","esprima","parse","module"],"_id":"sleuth@0.1.0","dist":{"shasum":"4cdcc3dfd53b96b2d4da07c2122e5b266a8a3635","tarball":"http://registry-npm.ywwl.com/sleuth/download/sleuth-0.1.0.tgz","integrity":"sha512-olF6JYZ9qh7RqteGAZZAJfMEcE2P4gBYz8v2b/l46hJjgie8yUKEcp5sr3UHKl4WVU/d9WZ7DYiXkSh5k1ZoxA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCe5ZMI3EYHWJURQq8DaIdmWGS6ucT0zZF3QvyZMkj9XwIgY/EMzYqVQMjjBt4XMmyD6g7Btpz2xIbJ9ZBPbiS1Eug="}],"size":2618,"noattachment":false,"key":"/sleuth/-/sleuth-0.1.0.tgz"},"_from":".","_npmVersion":"1.4.2","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"directories":{},"readme":"# sleuth [![Flattr this!](https://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=hughskennedy&url=http://github.com/hughsk/sleuth&title=sleuth&description=hughsk/sleuth%20on%20GitHub&language=en_GB&tags=flattr,github,javascript&category=software)[![experimental](http://hughsk.github.io/stability-badges/dist/experimental.svg)](http://github.com/hughsk/stability-badges) #\n\nDiscover the variable names chosen for each of a file's top-level required\nmodules.\n\nWon't pick up nested requires in if/for statements or inside functions, but is\nintended for detecting the names of variables to replace e.g. when creating\ninlining transforms such as [brfs](http://github.com/substack/brfs).\n\n## Usage ##\n\n[![sleuth](https://nodei.co/npm/sleuth.png?mini=true)](https://nodei.co/npm/sleuth)\n\n### `requires = sleuth(ast)` ###\n\nAccepts an [esprima](http://github.com/ariya/esprima)-like `ast` object.\n\nReturns an object whose keys represent the variable names used to require a\nmodule, and whose values are the required module strings detected.\n\n## Example ##\n\n``` javascript\nvar esprima = require('esprima')\nvar walkers = require('astw')\nvar files = require('fs')\n\nvar src = files.readFileSync(__filename, 'utf8')\nvar ast = esprima.parse(src)\n\n// Walk the generated AST\nvar result = sleuth(ast)\nconsole.log(result)\n\n// Or you can try it this way:\nvar result = sleuth(walkers(src))\nconsole.log(result)\n```\n\nWhich should give you back something like this:\n\n``` javascript\n{\n  esprima: 'esprima',\n  walkers: 'astw',\n  files: 'fs'\n}\n```\n\n## License ##\n\nMIT. See [LICENSE.md](http://github.com/hughsk/sleuth/blob/master/LICENSE.md) for details.\n","publish_time":1392821242763,"_cnpm_publish_time":1392821242763,"dist-tags":{"latest":"0.1.1"}}