Sha256: 2ef41461635fc6b9689fdf72a9989dd2f675757483d85658968056ccec0eab21

Contents?: true

Size: 427 Bytes

Versions: 54

Compression:

Stored size: 427 Bytes

Contents

module.exports = function (_require) {
  _require = _require || require
  var main = _require.main
  if (main && isIISNode(main)) return handleIISNode(main)
  else return main ? main.filename : process.cwd()
}

function isIISNode (main) {
  return /\\iisnode\\/.test(main.filename)
}

function handleIISNode (main) {
  if (!main.children.length) {
    return main.filename
  } else {
    return main.children[0].filename
  }
}

Version data entries

54 entries across 42 versions & 16 rubygems

Version Path
ezii-os-0.0.0.0.1 node_modules/webpack-cli/node_modules/require-main-filename/index.js
optimacms-0.4.3 spec/dummy/node_modules/require-main-filename/index.js
optimacms-0.4.2 spec/dummy/node_modules/require-main-filename/index.js
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/require-main-filename/index.js
lux_assets-0.2.11 ./node_modules/require-main-filename/index.js
lux_assets-0.2.9 ./node_modules/require-main-filename/index.js
lux_assets-0.2.4 ./node_modules/require-main-filename/index.js
lux_assets-0.2.2 ./node_modules/require-main-filename/index.js
lux_assets-0.2.1 ./node_modules/require-main-filename/index.js
locomotivecms-3.4.0 app/javascript/node_modules/require-main-filename/index.js
cortex-0.1.3 spec/dummy/node_modules/require-main-filename/index.js
dragonfly_puppeteer-0.1.0 node_modules/require-main-filename/index.js
lanes-0.8.0 node_modules/require-main-filename/index.js
blackboard-3.1.9 lib/site_template/node_modules/require-main-filename/index.js