0.0.5 • Published 9 years ago

req-dir v0.0.5

Weekly downloads
16
License
-
Repository
github
Last release
9 years ago

This module require all files from a directory (only .json, .js, and .coffee), inside a path you want, and return a object with this modules.

Usage

First install

npm i --save req-dir

And in your files, use:

var reqDir = require('req-dir');
var path = '.'; // path to dir, in this case, same directory
var controllers = reqDir(path);

Other examples:

var controllers = reqDir('./controllers');
var controllers = reqDir('../controllers');

Important

The path is relative to the file that calls the reqDir.

Tests

I use mocha for tests, first install mocha as global

npm i -g mocha

Then run tests with:

npm test

Enjoy!

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago