-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathindex.js
More file actions
47 lines (42 loc) · 839 Bytes
/
index.js
File metadata and controls
47 lines (42 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*!
* Meryl
* Copyright(c) 2010 Kadir Pekel.
* MIT Licensed
*/
/*
* Modules dependencies
*/
var path = require('path');
module.exports = require('./meryl');
/*
* Generic function tries to find a module
* with given module name under given directory name
*
* @param {String} dir
* @param {String} name
* @return {Object}
* @api private
*/
var find = function (dir, name) {
return require(path.join(__dirname, dir, name + '.js'));
};
/*
* Finds a plugin with given name
*
* @param {String} plugin
* @return {Object}
* @api public
*/
module.exports.findp = function (plugin) {
return find('plugins', plugin);
};
/*
* Finds an extension with given name
*
* @param {String} extension
* @return {Object}
* @api public
*/
module.exports.findx = function (extension) {
return find('extensions', extension);
};