allow requiring native node modules from backend scripts

This commit is contained in:
zadam
2019-08-12 20:41:38 +02:00
parent b1075d956f
commit dfa1ab65c6
3 changed files with 9 additions and 9 deletions

View File

@@ -11,7 +11,7 @@ function ScriptContext(allNotes, apiParams = {}) {
const note = candidates.find(c => c.title === moduleName);
if (!note) {
throw new Error("Could not find module note " + moduleName);
return require(moduleName);
}
return this.modules[note.noteId].exports;