File: //opt/code/node_modules/webpack/node_modules/yargs/node_modules/which-module/package.json
{
"name": "which-module",
"version": "1.0.0",
"description": "Find the module object for something that was require()d",
"main": "index.js",
"scripts": {
"pretest": "standard",
"test": "nyc ava",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"release": "standard-version"
},
"files": [
"index.js"
],
"repository": {
"type": "git",
"url": "git+https://github.com/nexdrew/which-module.git"
},
"keywords": [
"which",
"module",
"exports",
"filename",
"require",
"reverse",
"lookup"
],
"author": {
"name": "nexdrew"
},
"license": "ISC",
"bugs": {
"url": "https://github.com/nexdrew/which-module/issues"
},
"homepage": "https://github.com/nexdrew/which-module#readme",
"devDependencies": {
"ava": "^0.15.2",
"coveralls": "^2.11.9",
"nyc": "^6.4.4",
"standard": "^7.1.2",
"standard-version": "^2.3.0"
},
"readme": "# which-module\n\n> Find the module object for something that was require()d\n\n[](https://travis-ci.org/nexdrew/which-module)\n[](https://coveralls.io/github/nexdrew/which-module?branch=master)\n[](https://github.com/conventional-changelog/standard-version)\n\nFind the `module` object in `require.cache` for something that was `require()`d\nor `import`ed - essentially a reverse `require()` lookup.\n\nUseful for libs that want to e.g. lookup a filename for a module or submodule\nthat it did not `require()` itself.\n\n## Install and Usage\n\n```\nnpm install --save which-module\n```\n\n```js\nconst whichModule = require('which-module')\n\nconsole.log(whichModule(require('something')))\n// Module {\n// id: '/path/to/project/node_modules/something/index.js',\n// exports: [Function],\n// parent: ...,\n// filename: '/path/to/project/node_modules/something/index.js',\n// loaded: true,\n// children: [],\n// paths: [ '/path/to/project/node_modules/something/node_modules',\n// '/path/to/project/node_modules',\n// '/path/to/node_modules',\n// '/path/node_modules',\n// '/node_modules' ] }\n```\n\n## API\n\n### `whichModule(exported)`\n\nReturn the [`module` object](https://nodejs.org/api/modules.html#modules_the_module_object),\nif any, that represents the given argument in the `require.cache`.\n\n`exported` can be anything that was previously `require()`d or `import`ed as a\nmodule, submodule, or dependency - which means `exported` is identical to the\n`module.exports` returned by this method.\n\nIf `exported` did not come from the `exports` of a `module` in `require.cache`,\nthen this method returns `null`.\n\n## License\n\nISC © Contributors\n",
"readmeFilename": "README.md",
"_id": "which-module@1.0.0",
"dist": {
"shasum": "099c83edca518dbdabd6374fc1456cf395850782"
},
"_from": "which-module@^1.0.0",
"_resolved": "http://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz"
}