vesln/refractory — pull request #1 by logicalparadox (2013-11-10 09:41:08+00:00)
Title: add support for multiple paths and module names

##### ;TLDR

- exports and returned function support unlimited arguments
- priority based on order
- updated tests and fixtures
- updated readme

##### Explanation

This PR adds support for unlimited possible paths to check for existence of module. That way I could load from my internal lib, a user defined location, then from the users home directory. I also added support for multiple module names so that I could attempt on a namespaced version of the module before the exact module name.

##### Example

```js
// implementation
var load = refractory(__dirname + '/themes');

Logger.prototype.theme = function(name) {
this._theme = load('logger-theme-' + name, 'logger-' + name, name);
return this;
};

// usage
logger.theme('simple');
// attempted locations
// - __dirname/themes/logger-theme-simple
// - logger-theme-simple (node_modules)
// - __dirname/themes/logger-simple
// - logger-simple (node_modules)
// - __dirname/themes/simple
// - simple (node_modules)
```