source: trip-planner-front/node_modules/require-main-filename/index.js@ b738035

Last change on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 427 bytes
RevLine 
[6a3a178]1module.exports = function (_require) {
2 _require = _require || require
3 var main = _require.main
4 if (main && isIISNode(main)) return handleIISNode(main)
5 else return main ? main.filename : process.cwd()
6}
7
8function isIISNode (main) {
9 return /\\iisnode\\/.test(main.filename)
10}
11
12function handleIISNode (main) {
13 if (!main.children.length) {
14 return main.filename
15 } else {
16 return main.children[0].filename
17 }
18}
Note: See TracBrowser for help on using the repository browser.