I happen to come across a better require statement for project specific imports.
This line goes into app.js:
global.rootRequire = function (name) {
return require(__dirname + '/' + name);
}
This is helpful if you find yourself deep in a folder:
var auth = require('../../../auth/auth.service');
var auth = rootRequire('auth/auth.service');
Any thoughts?
I happen to come across a better
requirestatement for project specific imports.This line goes into
app.js:This is helpful if you find yourself deep in a folder:
Any thoughts?