Module

x/eta/file-utils.ts>getPath

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 "https://dotland.deno.dev/x/eta@v1.14.1/file-utils.ts";

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.

Parameters

path: string

specified path

options: EtaConfig

compilation options

Returns

string

absolute path to template