Skip to main content
Module

x/yargs/lib/utils/which-module.ts

yargs the modern, pirate-themed successor to optimist.
Go to Latest
File
export default function whichModule(exported: object) { if (typeof require === 'undefined') return null; for ( let i = 0, files = Object.keys(require.cache), mod; i < files.length; i++ ) { mod = require.cache[files[i]]; if (mod!.exports === exported) return mod; } return null;}