mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-20 17:32:15 +03:00
ad9d142174
no-issue
14 lines
403 B
JavaScript
14 lines
403 B
JavaScript
const Module = require('module');
|
|
|
|
module.exports.loadApp = function loadAppSandboxed(appPath) {
|
|
// Resolve the modules path
|
|
const resolvedModulePath = Module._resolveFilename(appPath, module.parent);
|
|
|
|
// Instantiate a Node Module class
|
|
const currentModule = new Module(resolvedModulePath, module.parent);
|
|
|
|
currentModule.load(currentModule.id);
|
|
|
|
return currentModule.exports;
|
|
};
|