Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fdaciuk/getmodule
Include local NodeJS modules relative to your root path
https://github.com/fdaciuk/getmodule
Last synced: about 1 month ago
JSON representation
Include local NodeJS modules relative to your root path
- Host: GitHub
- URL: https://github.com/fdaciuk/getmodule
- Owner: fdaciuk
- Created: 2014-12-27T14:53:43.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-09-04T23:19:33.000Z (about 9 years ago)
- Last Synced: 2024-10-09T12:09:13.575Z (about 1 month ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/getmodule
- Size: 262 KB
- Stars: 15
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# Get Module
> Include local NodeJS modules relative to your root path
[![NPM version][npm-version-image]][npm-version-url]
[![Build Status][travis-image]][travis-url]
[![Coverage Status][coveralls-image]][coveralls-url]
[![Code Climate][codeclimate-image]][codeclimate-url][![NPM][npm-image]][npm-url]
## Installation
```js
npm i --save getmodule
```## Usage
Add `getmodule` on top of your `app.js` (or _main file_ of your app):
```js
require( 'getmodule' );
```Now, you can call any module based on _root path_ of your application.
If your module is on `app/modules/mymodule.js`, but you're calling it on the
file `app/controllers/controller.js`; in tradicional mode, you needed to do:```js
var mymodule = require( '../modules/mymodule' );
```But with `getmodule`, you just need type this:
```js
var mymodule = getmodule( 'app/modules/mymodule' );
```## Contributing
Check [CONTRIBUTING.md][contributing-url]
## License
[MIT License][license-url] © Fernando Daciuk
[npm-version-image]: https://img.shields.io/npm/v/getmodule.svg?style=flat-square
[npm-version-url]: https://npmjs.org/package/getmodule
[travis-image]: https://img.shields.io/travis/fdaciuk/getmodule.svg?style=flat-square
[travis-url]: https://travis-ci.org/fdaciuk/getmodule
[coveralls-image]: https://img.shields.io/coveralls/fdaciuk/getmodule/master.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/fdaciuk/getmodule?branch=master
[npm-image]: https://nodei.co/npm/getmodule.png?downloads=true&downloadRank=true&stars=true
[npm-url]: https://nodei.co/npm/getmodule/
[codeclimate-image]: https://img.shields.io/codeclimate/github/fdaciuk/getmodule.svg?style=flat-square
[codeclimate-url]: https://codeclimate.com/github/fdaciuk/getmodule
[contributing-url]: CONTRIBUTING.md
[license-url]: https://github.com/fdaciuk/licenses/blob/master/MIT-LICENSE.md