mainify
v1.0.3
Published
browserify transform for require-relative-main
Downloads
3
Maintainers
Readme
mainify
browserify transform for require-relative-main
Install
$ npm install --save mainify
Usage
Application code:
require('require-relative-main')('./users')
Build:
browserify -t mainify ./
You can also use static paths as the `cwd:
require('require-relative-main')('./users', '../app')
You can even use __dirname
:
require('require-relative-main')('./users', __dirname)
You cannot assign require-relative-main to a variable and use it later:
var rrm = require('require-relative-main')
rrm('./module') // => this cannot be replaced
API
mainify(file)
-> transformStream
file
Required
Type: string
The file path to be processed. Browserify will pass this along automatically for each file when you use the transform.
License
MIT © Ben Drucker