UNPKG

eta

Version:

Lightweight, fast, and powerful embedded JS template engine

13 lines 577 B
import type { EtaConfig } from './config'; /** * 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** * * ```js * 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" * ``` */ export default function compileToString(str: string, config: EtaConfig): string; //# sourceMappingURL=compile-string.d.ts.map