{"_id":"babel-plugin-detective","_rev":"299602","name":"babel-plugin-detective","description":"Babel 5/6 plugin that scans the AST for require calls and import statements","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"novemberborn","email":"mark@novemberborn.net"}],"time":{"modified":"2021-06-03T19:03:28.000Z","created":"2015-11-15T11:22:37.732Z","2.0.0":"2016-07-01T23:27:31.639Z","1.0.2":"2016-03-18T20:58:42.252Z","1.0.1":"2016-01-02T12:54:05.763Z","1.0.0":"2016-01-02T12:28:06.187Z","0.0.5":"2015-11-16T04:12:34.452Z","0.0.4":"2015-11-16T03:50:47.647Z","0.0.3":"2015-11-16T02:48:28.503Z","0.0.2":"2015-11-15T11:51:23.845Z","0.0.1":"2015-11-15T11:22:37.732Z"},"users":{},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"repository":{"type":"git","url":"git+https://github.com/avajs/babel-plugin-detective.git"},"versions":{"2.0.0":{"name":"babel-plugin-detective","version":"2.0.0","description":"Babel 5/6 plugin that scans the AST for require calls and import statements","license":"MIT","repository":{"type":"git","url":"git+https://github.com/avajs/babel-plugin-detective.git"},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && nyc mocha","coveralls":"nyc report --reporter=text-lcov | coveralls"},"files":["index.js","wrap-listener.js"],"keywords":["babel-plugin","detective","require","import","dependencies","scan","traverse"],"devDependencies":{"babel":"^5.8.34","babel-core":"^6.1.21","babel-preset-es2015":"^6.1.18","babel-preset-stage-3":"^6.1.18","coveralls":"^2.11.4","mocha":"^2.3.3","nyc":"^6.4.4","xo":"^0.16.0"},"xo":{"ignores":["test/_utils.js"]},"gitHead":"379c7e924cefdef752a008daf3957087d5e68fac","bugs":{"url":"https://github.com/avajs/babel-plugin-detective/issues"},"homepage":"https://github.com/avajs/babel-plugin-detective#readme","_id":"babel-plugin-detective@2.0.0","_shasum":"6e642e83c22a335279754ebe2d754d2635f49f13","_from":".","_npmVersion":"3.8.6","_nodeVersion":"5.10.1","_npmUser":{"name":"jamestalmage","email":"james@talmage.io"},"dist":{"shasum":"6e642e83c22a335279754ebe2d754d2635f49f13","size":4725,"noattachment":false,"key":"/babel-plugin-detective/-/babel-plugin-detective-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-plugin-detective/download/babel-plugin-detective-2.0.0.tgz"},"maintainers":[{"name":"novemberborn","email":"mark@novemberborn.net"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/babel-plugin-detective-2.0.0.tgz_1467415649412_0.6153939245268703"},"directories":{},"publish_time":1467415651639,"_cnpm_publish_time":1467415651639,"_hasShrinkwrap":false},"1.0.2":{"name":"babel-plugin-detective","version":"1.0.2","description":"A Babel 5/6 plugin that scans the AST for require calls and import statements","license":"MIT","repository":{"type":"git","url":"git+https://github.com/jamestalmage/babel-plugin-detective.git"},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && nyc mocha","coveralls":"nyc report --reporter=text-lcov | coveralls"},"files":["index.js","wrap-listener.js"],"keywords":["babel-plugin","detective","require","import","dependencies","scan","traverse"],"devDependencies":{"babel":"^5.8.34","babel-core":"^6.1.21","babel-preset-es2015":"^6.1.18","babel-preset-stage-3":"^6.1.18","coveralls":"^2.11.4","mocha":"^2.3.3","nyc":"^3.2.2","xo":"^0.10.1"},"gitHead":"6dae06157228d42b310730444e449a338a420770","bugs":{"url":"https://github.com/jamestalmage/babel-plugin-detective/issues"},"homepage":"https://github.com/jamestalmage/babel-plugin-detective#readme","_id":"babel-plugin-detective@1.0.2","_shasum":"b55469c7c792dc4ee89c6f7daa31faedfa16232d","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.9.0","_npmUser":{"name":"jamestalmage","email":"james@talmage.io"},"dist":{"shasum":"b55469c7c792dc4ee89c6f7daa31faedfa16232d","size":4630,"noattachment":false,"key":"/babel-plugin-detective/-/babel-plugin-detective-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-plugin-detective/download/babel-plugin-detective-1.0.2.tgz"},"maintainers":[{"name":"novemberborn","email":"mark@novemberborn.net"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/babel-plugin-detective-1.0.2.tgz_1458334719866_0.7049440103583038"},"directories":{},"publish_time":1458334722252,"_cnpm_publish_time":1458334722252,"_hasShrinkwrap":false},"1.0.1":{"name":"babel-plugin-detective","version":"1.0.1","description":"A Babel 5/6 plugin that scans the AST for require calls and import statements","license":"MIT","repository":{"type":"git","url":"git+https://github.com/jamestalmage/babel-plugin-detective.git"},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && nyc mocha","coveralls":"nyc report --reporter=text-lcov | coveralls"},"files":["index.js","wrap-listener.js"],"keywords":["babel-plugin","detective","require","import","dependencies","scan","traverse"],"devDependencies":{"babel":"^5.8.34","babel-core":"^6.1.21","babel-preset-es2015":"^6.1.18","babel-preset-stage-3":"^6.1.18","coveralls":"^2.11.4","mocha":"^2.3.3","nyc":"^3.2.2","xo":"^0.10.1"},"gitHead":"6b06ad56b4263c3354e7f15b6aaf374dfbb37b0e","bugs":{"url":"https://github.com/jamestalmage/babel-plugin-detective/issues"},"homepage":"https://github.com/jamestalmage/babel-plugin-detective#readme","_id":"babel-plugin-detective@1.0.1","_shasum":"994895e5a1fb0dfac4d8fea681b627574cc771ae","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"jamestalmage","email":"james@talmage.io"},"dist":{"shasum":"994895e5a1fb0dfac4d8fea681b627574cc771ae","size":4550,"noattachment":false,"key":"/babel-plugin-detective/-/babel-plugin-detective-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-plugin-detective/download/babel-plugin-detective-1.0.1.tgz"},"maintainers":[{"name":"novemberborn","email":"mark@novemberborn.net"}],"directories":{},"publish_time":1451739245763,"_cnpm_publish_time":1451739245763,"_hasShrinkwrap":false},"1.0.0":{"name":"babel-plugin-detective","version":"1.0.0","description":"A Babel 5/6 plugin that scans the AST for require calls and import statements","license":"MIT","repository":{"type":"git","url":"git+https://github.com/jamestalmage/babel-plugin-detective.git"},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && nyc mocha","coveralls":"nyc report --reporter=text-lcov | coveralls"},"files":["index.js"],"keywords":["babel-plugin","detective","require","import","dependencies","scan","traverse"],"devDependencies":{"babel":"^5.8.34","babel-core":"^6.1.21","babel-preset-es2015":"^6.1.18","babel-preset-stage-3":"^6.1.18","coveralls":"^2.11.4","mocha":"^2.3.3","nyc":"^3.2.2","xo":"^0.10.1"},"gitHead":"1332c046af6d0889b92cc83b671b9d7963874fc7","bugs":{"url":"https://github.com/jamestalmage/babel-plugin-detective/issues"},"homepage":"https://github.com/jamestalmage/babel-plugin-detective#readme","_id":"babel-plugin-detective@1.0.0","_shasum":"cf807aaaa2ad8abb18fb8c135b68463972808feb","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"jamestalmage","email":"james@talmage.io"},"dist":{"shasum":"cf807aaaa2ad8abb18fb8c135b68463972808feb","size":4117,"noattachment":false,"key":"/babel-plugin-detective/-/babel-plugin-detective-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-plugin-detective/download/babel-plugin-detective-1.0.0.tgz"},"maintainers":[{"name":"novemberborn","email":"mark@novemberborn.net"}],"directories":{},"publish_time":1451737686187,"_cnpm_publish_time":1451737686187,"_hasShrinkwrap":false},"0.0.5":{"name":"babel-plugin-detective","version":"0.0.5","description":"A Babel 5/6 plugin that scans the AST for require calls and import statements","license":"MIT","repository":{"type":"git","url":"git+https://github.com/jamestalmage/babel-plugin-detective.git"},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && nyc mocha","coveralls":"nyc report --reporter=text-lcov | coveralls"},"files":["index.js"],"keywords":["babel-plugin","detective","require","import","dependencies","scan","traverse"],"devDependencies":{"babel":"^5.8.34","babel-core":"^6.1.21","babel-preset-es2015":"^6.1.18","babel-preset-stage-3":"^6.1.18","coveralls":"^2.11.4","mocha":"^2.3.3","nyc":"^3.2.2","xo":"^0.10.1"},"gitHead":"94c1fcdfb8b54792bee7266e7644d09d98ac8bfb","bugs":{"url":"https://github.com/jamestalmage/babel-plugin-detective/issues"},"homepage":"https://github.com/jamestalmage/babel-plugin-detective#readme","_id":"babel-plugin-detective@0.0.5","_shasum":"f21f534863d2d1d74771c5b58328ae929fbb4d5b","_from":".","_npmVersion":"3.4.0","_nodeVersion":"4.1.2","_npmUser":{"name":"jamestalmage","email":"james@talmage.io"},"dist":{"shasum":"f21f534863d2d1d74771c5b58328ae929fbb4d5b","size":3837,"noattachment":false,"key":"/babel-plugin-detective/-/babel-plugin-detective-0.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-plugin-detective/download/babel-plugin-detective-0.0.5.tgz"},"maintainers":[{"name":"novemberborn","email":"mark@novemberborn.net"}],"directories":{},"publish_time":1447647154452,"_cnpm_publish_time":1447647154452,"_hasShrinkwrap":false},"0.0.4":{"name":"babel-plugin-detective","version":"0.0.4","description":"A Babel 5/6 plugin that scans the AST for require calls and import statements","license":"MIT","repository":{"type":"git","url":"git+https://github.com/jamestalmage/babel-plugin-detective.git"},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && nyc mocha","coveralls":"nyc report --reporter=text-lcov | coveralls"},"files":["index.js"],"keywords":["babel-plugin","detective","require","import","dependencies","scan","traverse"],"devDependencies":{"babel-core":"^6.1.21","babel-preset-es2015":"^6.1.18","babel-preset-stage-3":"^6.1.18","babylon":"^6.1.21","coveralls":"^2.11.4","mocha":"^2.3.3","nyc":"^3.2.2","xo":"^0.10.1"},"gitHead":"86a1782e20154560d01211881107df0652539e39","bugs":{"url":"https://github.com/jamestalmage/babel-plugin-detective/issues"},"homepage":"https://github.com/jamestalmage/babel-plugin-detective#readme","_id":"babel-plugin-detective@0.0.4","_shasum":"bcb0a10501110e199d42bf5a8a3756963b4ea3ea","_from":".","_npmVersion":"3.4.0","_nodeVersion":"4.1.2","_npmUser":{"name":"jamestalmage","email":"james@talmage.io"},"dist":{"shasum":"bcb0a10501110e199d42bf5a8a3756963b4ea3ea","size":3833,"noattachment":false,"key":"/babel-plugin-detective/-/babel-plugin-detective-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-plugin-detective/download/babel-plugin-detective-0.0.4.tgz"},"maintainers":[{"name":"novemberborn","email":"mark@novemberborn.net"}],"directories":{},"publish_time":1447645847647,"_cnpm_publish_time":1447645847647,"_hasShrinkwrap":false},"0.0.3":{"name":"babel-plugin-detective","version":"0.0.3","description":"A Babel 5/6 plugin that scans the AST for require calls and import statements","license":"MIT","repository":{"type":"git","url":"git+https://github.com/jamestalmage/babel-plugin-detective.git"},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && nyc mocha","coveralls":"nyc report --reporter=text-lcov | coveralls"},"files":["index.js"],"keywords":["babel-plugin","detective","require","import","dependencies","scan","traverse"],"devDependencies":{"babel-core":"^6.1.21","babel-preset-es2015":"^6.1.18","babel-preset-stage-3":"^6.1.18","babylon":"^6.1.21","coveralls":"^2.11.4","mocha":"^2.3.3","nyc":"^3.2.2","xo":"^0.10.1"},"gitHead":"5995199dee5cc1d0c194fc3cffb3ab06d94aa0b6","bugs":{"url":"https://github.com/jamestalmage/babel-plugin-detective/issues"},"homepage":"https://github.com/jamestalmage/babel-plugin-detective#readme","_id":"babel-plugin-detective@0.0.3","_shasum":"bd853adf3f988980f000d4b2bb3e937dfe2fa3ac","_from":".","_npmVersion":"3.4.0","_nodeVersion":"4.1.2","_npmUser":{"name":"jamestalmage","email":"james@talmage.io"},"dist":{"shasum":"bd853adf3f988980f000d4b2bb3e937dfe2fa3ac","size":3627,"noattachment":false,"key":"/babel-plugin-detective/-/babel-plugin-detective-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-plugin-detective/download/babel-plugin-detective-0.0.3.tgz"},"maintainers":[{"name":"novemberborn","email":"mark@novemberborn.net"}],"directories":{},"publish_time":1447642108503,"_cnpm_publish_time":1447642108503,"_hasShrinkwrap":false},"0.0.2":{"name":"babel-plugin-detective","version":"0.0.2","description":"A Babel 6 plugin that scans the AST for require calls and import statements","license":"MIT","repository":{"type":"git","url":"git+https://github.com/jamestalmage/babel-plugin-detective.git"},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && nyc mocha","coveralls":"nyc report --reporter=text-lcov | coveralls"},"files":["index.js"],"keywords":["babel-plugin","detective","require","import","dependencies","scan","traverse"],"devDependencies":{"babel-core":"^6.1.21","babel-preset-es2015":"^6.1.18","babel-preset-stage-3":"^6.1.18","babylon":"^6.1.21","coveralls":"^2.11.4","mocha":"^2.3.3","nyc":"^3.2.2","xo":"^0.10.1"},"gitHead":"3022139441d3882c81c42d5af52d27602f27de91","bugs":{"url":"https://github.com/jamestalmage/babel-plugin-detective/issues"},"homepage":"https://github.com/jamestalmage/babel-plugin-detective#readme","_id":"babel-plugin-detective@0.0.2","_shasum":"e72f70a6d955f321065557a5c5a8eca794476a20","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.2","_npmUser":{"name":"jamestalmage","email":"james@talmage.io"},"dist":{"shasum":"e72f70a6d955f321065557a5c5a8eca794476a20","size":3358,"noattachment":false,"key":"/babel-plugin-detective/-/babel-plugin-detective-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-plugin-detective/download/babel-plugin-detective-0.0.2.tgz"},"maintainers":[{"name":"novemberborn","email":"mark@novemberborn.net"}],"directories":{},"publish_time":1447588283845,"_cnpm_publish_time":1447588283845,"_hasShrinkwrap":false},"0.0.1":{"name":"babel-plugin-detective","version":"0.0.1","description":"A Babel 6 plugin that scans the AST for require calls and import statements","license":"MIT","repository":{"type":"git","url":"git+https://github.com/jamestalmage/babel-plugin-detective.git"},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && nyc mocha"},"files":["index.js"],"keywords":["babel-plugin","detective","require","import","dependencies","scan","traverse"],"devDependencies":{"babel-core":"^6.1.21","babel-preset-es2015":"^6.1.18","babel-preset-stage-3":"^6.1.18","babylon":"^6.1.21","mocha":"^2.3.3","nyc":"^3.2.2"},"gitHead":"dc623d152f6b23834e41e35311247f90dd968d26","bugs":{"url":"https://github.com/jamestalmage/babel-plugin-detective/issues"},"homepage":"https://github.com/jamestalmage/babel-plugin-detective#readme","_id":"babel-plugin-detective@0.0.1","_shasum":"7be06eb2fc4be11b24143c69acab8f8f98423df4","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.2","_npmUser":{"name":"jamestalmage","email":"james@talmage.io"},"dist":{"shasum":"7be06eb2fc4be11b24143c69acab8f8f98423df4","size":3072,"noattachment":false,"key":"/babel-plugin-detective/-/babel-plugin-detective-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-plugin-detective/download/babel-plugin-detective-0.0.1.tgz"},"maintainers":[{"name":"novemberborn","email":"mark@novemberborn.net"}],"directories":{},"publish_time":1447586557732,"_cnpm_publish_time":1447586557732,"_hasShrinkwrap":false}},"readme":"# babel-plugin-detective [![Build Status](https://travis-ci.org/avajs/babel-plugin-detective.svg?branch=master)](https://travis-ci.org/avajs/babel-plugin-detective) [![Coverage Status](https://coveralls.io/repos/github/avajs/babel-plugin-detective/badge.svg?branch=master)](https://coveralls.io/avajs/babel-plugin-detective?branch=master)\n\n> Babel 5/6 plugin that scans the AST for require calls and import statements\n\n\n## Install\n\n```\n$ npm install --save babel-plugin-detective babel-core\n```\n\n\n## Usage\n\n```js\nimport babel from 'babel-core';\n\nconst detective = require('babel-plugin-detective');\nconst myModule = require('my' + 'module');\n\n// See below for available options\nconst options = {};\n\n// Babel 5\n// `position` can be 'before' or 'after'\nlet result = babel.transformFileSync(path, {\n\tplugins: [{transformer: detective, position: position}],\n\textra: {\n\t\t\tdetective: options\n\t}\n});\n\n// Babel 6\nresult = babel.transformFileAsync('/path/to/file', {\n\tplugins:[['detective', options]]\n});\n\n// metadata will be stored on `result.metadata.requires`\n// a convenience method is provided to extract it.\nconst metadata = detective.metadata(result);\n\nconsole.log(metadata);\n// {\n//   strings: [\n//     'babel-core',\n//     'babel-plugin-detective'\n//   ],\n//   expressions: [\n//     {start: 110, end: 125, loc: {...}} // loc of 'my' + 'module' expression\n//   ]\n// }\n```\n\n## API\n\n### detective.metadata(previousParseResult)\n\nDuring traversal, the plugin stores each discovered require/import on the Babel metadata object.\nIt can be extracted manually from `parseResult.metadata.requires`, or you can pass the parse result\nto this convenience method.\n\n## Returned Metadata\n\nAfter a babel traversal with this plugin, metadata will be attached at `parseResult.metadata.requires`\n\n### requires.strings\n\nType: `Array<string>`\n\nArray of every module imported with an ES2015 import statement, and every module `required` using a string literal (it does not include dynamic requires).\n\n### requires.expressions\n\nType: `Array<locationData>`\n\nArray of location data for expressions that are used as the first argument to `require` (i.e. dynamic requires).\n The source of the expression can be attached using the `attachExpressionSource` option.\n If you wish to disallow dynamic requires, you should throw if this has length greater than 0.\n\n## Options\n\n### options.generated\n\nType: `boolean`\nDefault: `false`\n\nIf set to true, it will include `require` calls generated by previous plugins in the\n tool chain. This will lead to some duplicate entries if ES2015 import statements are\n present in the file. This plugin already scans for ES2015 import statements, so you\n only need to use this if there is some other type of generated require statement you\n want to know about.\n\n*Works on Babel 6 only*\n\n`generated:true` can be combined with `import:false` to get only the `require`\nstatements of the post transform code.\n\n### options.import\n\nType: `boolean`<br>\nDefault: `true`\n\nInclude ES2015 imports in the metadata. All ES2015 imports will be of type `string`.\n\n### options.export\n\nType: `boolean`<br>\nDefault: `true`\n\nInclude ES2015 re-exports in the metadata. All ES2015 re-exports will be of type `string`.\n\n```js\nexport * from './foo';\nexport {bar as baz} from './quz';\nexport {hello} from './goodbye';\n```\n\n### options.require\n\nType: `boolean`<br>\nDefault: `true`\n\nInclude CommonJS style `require(...)` statements in the metadata. CommonJS require statements will be pushed on to `requires.strings` if the argument is a string literal. For dynamic expressions (i.e. `require(foo + bar)`), an object will be pushed on to `requires.expressions`. It will have `start` and `end` properties that can be used to extract the code directly from the original source, And a `loc` object that includes the line/column numbers (useful for creating error statements).\n\n### options.word\n\nType: `string`<br>\nDefault: `'require'`\n\nThe name of the require function. You most likely do not need to change this.\n\n### options.source\n\nType: `boolean`<br>\nDefault: `false`\n\nAttach the actual expression code to each member of `requires.expressions`.\n\n```js\nexpressions: [\n\t {start: 110, end: 125, loc: {...} code: \"'my' + 'module'\"}\n]\n```\n\n### options.nodes\n\nType: `boolean`<br>\nDefault: `false`\n\nReturn the actual nodes instead of extracting strings.\n\n```js\nstrings : [{type: 'StringLiteral', value: 'foo', ...}],\nexpressions: [\n\t {type: 'BinaryExpression', ...}\n]\n```\n\nEverything in `strings` will be a `Literal` (*Babel 5*), or `StringLiteral` (*Babel 6*). The path required will be on `node.value`.\n\nThe `expressions` array can contain any valid `Expression` node.\n\n## Manipulating Require Statements\n\n*Warning: Exploratory Support Only*: The documentation here is intentionally sparse. While every attempt will be made to avoid breaking changes, it is a new feature so changes are a real possibility. You should look at the source of `index.js` and the test suite for a better idea on how to use this.\n\n`babel-detective/wrap-listener` allows you to create your own plugin that can manipulate exports.\n\nThe following creates a plugin that upper-cases all require and import statements:\n\n```js\nconst wrapListener = require('babel-detective/wrap-listener');\n\nmodule.exports = wrapListener(listener, 'uppercase');\n\nfunction listener(path, file, opts) {\n\tif (path.isLiteral()) {\n\t\tpath.node.value = path.node.value.toUpperCase();\n\t}\n}\n```\n\n### wrapListener(listener, name, options)\n\n#### listener\n\nType: `callback(nodePath, file, opts)`\n*Required*\n\nA listener that performs the actual manipulation. It is called with:\n\n- `nodePath`: The actual node in question can be accessed via `nodePath.node`. `nodePath` has other properties (`parent`, `isLiteral()`, etc.). A full description of that API is out of scope for this document.\n\n- `file`: The Babel file metadata object. This is what the main module uses to store metadata for required modules that it finds.\n\n- `opts`: The options that were passed to the plugin. This is done via the array syntax in Babel 6, or `options.extra[name]` in Babel 5.\n\n\n#### name\n\n*Required*<br>\nType: `string`\n\nThis is the key used to locate `opts` in Babel 5 `options.extra[name]`.\n\n#### options\n\n*Optional*\n\nAccepts the `import`, `require`, and `generated` options as described above.\n\n\n## Related\n\n- [`node-detective`](https://github.com/substack/node-detective) Inspiration for this module. Used by `browserify` to analyze module dependencies.\n\n\n## License\n\nMIT © [James Talmage](https://github.com/jamestalmage)\n","_attachments":{},"homepage":"https://github.com/avajs/babel-plugin-detective#readme","bugs":{"url":"https://github.com/avajs/babel-plugin-detective/issues"},"license":"MIT"}