source: trip-planner-front/node_modules/require-main-filename/README.md@ 571e0df

Last change on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.0 KB
RevLine 
[6a3a178]1# require-main-filename
2
3[![Build Status](https://travis-ci.org/yargs/require-main-filename.png)](https://travis-ci.org/yargs/require-main-filename)
4[![Coverage Status](https://coveralls.io/repos/yargs/require-main-filename/badge.svg?branch=master)](https://coveralls.io/r/yargs/require-main-filename?branch=master)
5[![NPM version](https://img.shields.io/npm/v/require-main-filename.svg)](https://www.npmjs.com/package/require-main-filename)
6
7`require.main.filename` is great for figuring out the entry
8point for the current application. This can be combined with a module like
9[pkg-conf](https://www.npmjs.com/package/pkg-conf) to, _as if by magic_, load
10top-level configuration.
11
12Unfortunately, `require.main.filename` sometimes fails when an application is
13executed with an alternative process manager, e.g., [iisnode](https://github.com/tjanczuk/iisnode).
14
15`require-main-filename` is a shim that addresses this problem.
16
17## Usage
18
19```js
20var main = require('require-main-filename')()
21// use main as an alternative to require.main.filename.
22```
23
24## License
25
26ISC
Note: See TracBrowser for help on using the repository browser.