Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

require-main-filename

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

require-main-filename

shim for require.main.filename() that works in as many environments as possible

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
23M
-6.29%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

require

FAQs

Package last updated on 28 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts