Use Statement
Introduction
One of the unique and powerful features of EJS is its approach to managing dependencies. Combining the succinctness of synchronous syntax with the performance benefits of asynchronous, batched file loading allows each class to declare its dependencies using simple use statements.
Exporting is handled using CommonJS module syntax:
MyClass.js
Further, using registered file handlers, the application can automatically handle each file type differently: a class will be handled one way whereas a Vue component will be handled another and JSON files yet another.
Last updated