node/deps/npm/node_modules/require-main-filename
claudiahdz db54b57042 deps: upgrade npm to 6.14.7
PR-URL: https://github.com/nodejs/node/pull/34468
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruy Adorno <ruyadorno@github.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-07-26 22:30:56 -07:00
..
CHANGELOG.md deps: upgrade npm to 6.14.7 2020-07-26 22:30:56 -07:00
index.js deps: upgrade npm to 6.1.0 2018-05-24 23:24:45 -07:00
LICENSE.txt deps: upgrade npm to 6.1.0 2018-05-24 23:24:45 -07:00
package.json deps: upgrade npm to 6.14.7 2020-07-26 22:30:56 -07:00
README.md deps: upgrade npm to 6.1.0 2018-05-24 23:24:45 -07:00

require-main-filename

Build Status Coverage Status NPM version

require.main.filename is great for figuring out the entry point for the current application. This can be combined with a module like pkg-conf to, as if by magic, load top-level configuration.

Unfortunately, require.main.filename sometimes fails when an application is executed with an alternative process manager, e.g., iisnode.

require-main-filename is a shim that addresses this problem.

Usage

var main = require('require-main-filename')()
// use main as an alternative to require.main.filename.

License

ISC