Archived
1
0
This repository has been archived on 2023-05-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
home-page/node_modules/require-main-filename
Sean Edmunds 3e953ad8d2 v1.1 update - stable
this version will run with npm start, but when attempting to run the built version behind nginx, it appears to have issues
2021-12-15 01:48:50 +00:00
..
2021-12-13 17:00:40 -06:00
2021-12-13 17:00:40 -06:00
2021-12-13 17:00:40 -06:00
2021-12-15 01:48:50 +00:00
2021-12-13 17:00:40 -06: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