Skip to main content


Embedded JS template engine for Node, Deno, and the browser. Lighweight, fast, and pluggable. Written in TypeScript
Go to Latest
function getPath
import { getPath } from "";

Get the absolute path to an included template

If this is called with an absolute path (for example, starting with '/' or 'C:') then Eta will attempt to resolve the absolute path within options.views. If it cannot, Eta will fallback to options.root or '/'

If this is called with a relative path, Eta will:

  • Look relative to the current template (if the current template has the filename property)
  • Look inside each directory in options.views

Note: if Eta is unable to find a template using path and options, it will throw an error.


path: string

specified path

options: EtaConfig

compilation options



absolute path to template