main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
340 bytes
|
Line | |
---|
1 | var resolve = require('resolve');
|
---|
2 |
|
---|
3 | module.exports = function (cwd, moduleName, register) {
|
---|
4 | var result;
|
---|
5 | try {
|
---|
6 | var modulePath = resolve.sync(moduleName, { basedir: cwd });
|
---|
7 | result = require(modulePath);
|
---|
8 | if (typeof register === 'function') {
|
---|
9 | register(result);
|
---|
10 | }
|
---|
11 | } catch (e) {
|
---|
12 | result = e;
|
---|
13 | }
|
---|
14 | return result;
|
---|
15 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.