0.4.1 • Published 1 year ago

embedded-ts v0.4.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Embedded TypeScript (ETS)

A port of EJS to support embedded TypeScript.

Usage

import * as ets from 'embedded-ts';

console.log(
  await ets.render(`
    <%
      let x: string
      x = "hello";
    %>
    <%= x %>
  `)
);

// Outputs: "hello"

Differences from EJS

  • For simplicity and consistency, all render functions are now asynchronous, so there is no async option. This also means that include functions now return promises, so to include another .ets file, you must use await include('path/to/ets/file').

  • There is no client option in ETS.

  • The with statement is now always used internally to expose provided data to the template. Thus, the _with and destructuredLocals options have been removed.

  • The strict option has been removed; all templates are now executed in the context of a strict-mode asynchronous IIFE.

  • The option to set global delimiters, opening brackets, and closing brackets through ets.delimiter = '?' has been removed. Instead, pass the delimiter to each render function or create a wrapper function.

0.4.1

1 year ago

0.4.0

1 year ago

0.3.4

2 years ago

0.3.2

2 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.1.2

2 years ago

0.2.0

2 years ago

0.3.1

2 years ago

0.1.3

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.1

2 years ago