Using classes in Templater

Using Javascript classes in Templater

User script

// myUserScript.js

class SomeClass {
  functionOne () { 
    new Notice('functionOne', 5000) 
  }

  functionTwo () { 
    new Notice('functionTwo', 5000) 
  }
}

module.exports = SomeClass

Template

<%* 
// Templater template
const foo = new tp.user.myUserScript
foo.functionTwo()
%>
Published with Share Note 🌓