require-walk

1.0.0 • Public • Published

require-walk

Recursively require Node.js modules and apply optional parameters

Build Status
Coverage Status
NPM version
Dependency Status

Example uage

Example 1: ExpressJS/KoaJS routes with parameters

Instead of this:

require('./routes/routes-users.js')(app);
require('./routes/routes-default.js')(app);
require('./routes/routes-auth.js')(app);

You can do:

var requireWalk = require('require-walk');

requireWalk(__dirname + '/routes')(app);

Example 2: MongooseJS models with no parameters

var requireWalk = require('require-walk');

requireWalk(__dirname + '/models')();

Tests with code coverage report in test/coverage

git clone the full repo

npm install

npm test

Linting

./node_modules/jshint/bin/jshint lib/*.js

./node_modules/jshint/bin/jshint test/*.spec.js

Readme

Keywords

Package Sidebar

Install

npm i require-walk

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • rudijs