source: imaps-frontend/node_modules/rechoir/lib/register.js

main
Last change on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 340 bytes
RevLine 
[79a0317]1var resolve = require('resolve');
2
3module.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.