1.1.6 • Published 10 years ago

require-relative-main v1.1.6

Weekly downloads
12
License
MIT
Repository
github
Last release
10 years ago

require-relative-main Build Status

require a module relative to the "main" script

Install

$ npm install --save require-relative-main

Usage

var requireRelativeMain = require('require-relative-main');

requireRelativeMain('./foo', __dirname);

API

requireRelativeMain(modulePath, [cwd]) -> any

modulePath

Required
Type: string

The path to the module to be required. This will be required relative to the "main" entry for the package.

cwd

Type: string
Default: process.cwd()

The working directory from which to look upwards for the package.json file that specifies the main script. You should typically specify __dirname.

Browserify

Use the mainify transform in your package if you plan to use require-relative-main with Browserify.

License

MIT © Ben Drucker

1.1.6

10 years ago

1.1.5

10 years ago

1.1.4

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago