UNPKG

better-npm-init

Version:

A better version of npm init, with templates and more. Usage: better-npm-init <template> [--yarn] [--install] [--git] [--yes] [--help]

11 lines (10 loc) 321 B
export default function whichModule(exported) { 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; }