require-main-filename

2.0.0last stable release 6 years ago
Complexity Score
Low
Open Issues
8
Dependent Projects
580
Weekly Downloadsglobal
21,956,975

License

  • ISC
    • Yesattribution
    • Permissivelinking
    • Permissivedistribution
    • Permissivemodification
    • Nopatent grant
    • Yesprivate use
    • Permissivesublicensing
    • Notrademark grant

Downloads

Readme

require-main-filename

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

Dependencies

No runtime dependency information found for this package.

CVE IssuesActive
0
Scorecards Score
3.20
Test Coverage
100.00%
Follows Semver
Yes
Github Stars
19
Dependenciestotal
4
DependenciesOutdated
3
DependenciesDeprecated
0
Threat Modelling
No
Repo Audits
No

Learn how to distribute require-main-filename in your own private NPM registry

npm config set registry  https://npm.cloudsmith.com/owner/repo
Processing...
Done
npm install require-main-filename
Processing...
Done

3 Releases

NPM on Cloudsmith

Getting started with NPM on Cloudsmith is fast and easy.