Create a mojo.js plugin.
npm create @mojojs/plugin
TypeScript is also supported.
npm create @mojojs/plugin -- --ts
Alternatively you can also just fork the mojo-plugin-ejs repo on GitHub.
If you have any questions the documentation might not yet answer, don't hesitate to ask in the Forum, on Matrix, or IRC.