mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 11:56:01 +01:00
allow requiring native node modules from backend scripts
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user