mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-30 01:07:01 +08:00
`manage_node_deps.py` was changed in https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2259834 to add line endings at the end of the package.json file However, `npm run install-deps` was not rerun to add the line endings. To prevent future CLs that add deps to include the line ending changes, fix them in this CL. R=mathias@chromium.org Change-Id: Id4ee0003520c4aa0cb55494cdf64df57e31a86d7 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2263952 Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org> Commit-Queue: Mathias Bynens <mathias@chromium.org> Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Mathias Bynens <mathias@chromium.org>
which-module
Find the module object for something that was require()d
Find the module object in require.cache for something that was require()d
or imported - essentially a reverse require() lookup.
Useful for libs that want to e.g. lookup a filename for a module or submodule
that it did not require() itself.
Install and Usage
npm install --save which-module
const whichModule = require('which-module')
console.log(whichModule(require('something')))
// Module {
// id: '/path/to/project/node_modules/something/index.js',
// exports: [Function],
// parent: ...,
// filename: '/path/to/project/node_modules/something/index.js',
// loaded: true,
// children: [],
// paths: [ '/path/to/project/node_modules/something/node_modules',
// '/path/to/project/node_modules',
// '/path/to/node_modules',
// '/path/node_modules',
// '/node_modules' ] }
API
whichModule(exported)
Return the module object,
if any, that represents the given argument in the require.cache.
exported can be anything that was previously require()d or imported as a
module, submodule, or dependency - which means exported is identical to the
module.exports returned by this method.
If exported did not come from the exports of a module in require.cache,
then this method returns null.
License
ISC © Contributors