mde / ejs

Embedded JavaScript templates -- http://ejs.co
Apache License 2.0
7.7k stars 841 forks source link

Using ejs inside a js file #703

Closed vrzc closed 1 year ago

vrzc commented 1 year ago

i was wondering if it's possible to use ejs inside a js file other than using it inside the script tag

mde commented 1 year ago

Depends on whether you mean client-side or server-side. Essentially all EJS does is evaluate a bunch of JavaScript and spit out a string. What you do with that string is up to you. You could use EJS to create JavaScript source code, or even (I have done thing) to generate other EJS templates.