Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/view_engine/deps.ts>eta.compileToString

🚀A Template View Engine for Deno frameworks
Latest
function eta.compileToString
import { eta } from "https://deno.land/x/view_engine@v10.6.0/deps.ts";
const { compileToString } = eta;

Compiles a template string to a function string. Most often users just use compile(), which calls compileToString and creates a new function using the result

Example

compileToString("Hi <%= it.user %>", eta.config)
// "var tR='',include=E.include.bind(E),includeFile=E.includeFile.bind(E);tR+='Hi ';tR+=E.e(it.user);if(cb){cb(null,tR)} return tR"

Parameters

str: string
config: EtaConfig

Returns

string