{"_id":"sleuth","_rev":"8-e3facc5e73a96840a7a1360db39c15a8","name":"sleuth","description":"Discover the variable names chosen for each of a file's top-level required modules","dist-tags":{"latest":"0.1.1"},"versions":{"0.0.0":{"name":"sleuth","description":"Like detective, find all calls to require by walking the AST, however also supply the variable name used if available","version":"0.0.0","main":"index.js","browser":"index.js","dependencies":{"is-require":"0.0.0","static-eval":"~0.1.0","astw":"~0.1.0"},"devDependencies":{"esprima":"~1.0.4","tape":"~2.4.2"},"scripts":{},"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.0.0","dist":{"shasum":"b33c12688a5c7f01fca9863dd95db629a03af31b","tarball":"https://registry.npmjs.org/sleuth/-/sleuth-0.0.0.tgz","integrity":"sha512-3LrHCyWu3mqsuB1JY0mTa2gJhAh85sdY1pQOT5IEQdy8jROV1K6QMV0nmUAQ7ibTYlB33tSWoO9WVt09fzwktQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrDpZNcmQeY9f+deL6m78SbpkXqyBcAdetBVuGSTIYAAIhALTRYs1XX35y8xkG4IJY186JNZE/lJEc8DawdGNnnD4+"}]},"_from":".","_npmVersion":"1.4.2","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}]},"0.1.0":{"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":"https://registry.npmjs.org/sleuth/-/sleuth-0.1.0.tgz","integrity":"sha512-olF6JYZ9qh7RqteGAZZAJfMEcE2P4gBYz8v2b/l46hJjgie8yUKEcp5sr3UHKl4WVU/d9WZ7DYiXkSh5k1ZoxA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCe5ZMI3EYHWJURQq8DaIdmWGS6ucT0zZF3QvyZMkj9XwIgY/EMzYqVQMjjBt4XMmyD6g7Btpz2xIbJ9ZBPbiS1Eug="}]},"_from":".","_npmVersion":"1.4.2","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}]},"0.1.1":{"name":"sleuth","description":"Discover the variable names chosen for each of a file's top-level required modules","version":"0.1.1","main":"index.js","browser":"index.js","dependencies":{"is-require":"0.0.1","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"],"gitHead":"22e5ea466d1b95035744bfe3d7b3ab8663ffb8f4","_id":"sleuth@0.1.1","_shasum":"406efb86730ba5c27147b570186d72c83b0d8cc0","_from":".","_npmVersion":"1.4.13","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"dist":{"shasum":"406efb86730ba5c27147b570186d72c83b0d8cc0","tarball":"https://registry.npmjs.org/sleuth/-/sleuth-0.1.1.tgz","integrity":"sha512-x9msqhyOx9CoQnBH6cKz6CIi4brtwke+obbrFdA1Y7FVLhY/vn3By0Al1ydGLZM0hczWNp2Ahx/4G+3zebVIxQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBGHKG6UiF5pTVM97tkHBzYG1UzGxZgpHSf1oxW80NQDAiEA19W9bH0FXzTv79rhAlaBvRjpg5WcXEy8lPeEiUsuKmY="}]}}},"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","maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"time":{"modified":"2022-06-26T20:54:42.492Z","created":"2014-02-18T15:11:54.379Z","0.0.0":"2014-02-18T15:11:54.379Z","0.1.0":"2014-02-19T14:47:22.763Z","0.1.1":"2014-06-29T02:20:23.382Z"},"readmeFilename":"README.md","homepage":"https://github.com/hughsk/sleuth","keywords":["analyse","discover","detect","detective","require","ast","esprima","parse","module"],"repository":{"type":"git","url":"git://github.com/hughsk/sleuth"},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughsk.io/"},"bugs":{"url":"https://github.com/hughsk/sleuth/issues"},"license":"MIT"}