Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/s-a/fake-require-main
Fakes require.main for debug and testing purposes.
https://github.com/s-a/fake-require-main
Last synced: about 1 month ago
JSON representation
Fakes require.main for debug and testing purposes.
- Host: GitHub
- URL: https://github.com/s-a/fake-require-main
- Owner: s-a
- License: other
- Created: 2015-08-19T19:49:04.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-08-20T08:45:29.000Z (over 9 years ago)
- Last Synced: 2024-12-17T15:49:38.475Z (2 months ago)
- Language: JavaScript
- Homepage: https://github.com/s-a/iron-node
- Size: 121 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
## About
Fakes ```process.mainModule``` and ```require.main``` for debug and testing purposes.[](https://www.npmjs.org/package/fake-require-main)
[](https://travis-ci.org/s-a/fake-require-main)## Usage
```javascript
// Always overwrite the main module. Use this to code your own conditions for an overwrite.
require("fake-require-main").fake(require, __filename);// Overwrite the main module if called by a specific command line application.
require("fake-require-main").fakeFor(require, __filename, "electron");```
See [/test/main.js](/test/main.js) for more details.
## [Contributing](/CONTRIBUTING.md)
## [License](/LICENSE.md)