dpl

  • deno template engine.
  • dpl can render ejs with simple rules.

Features

Supported

  • <%= %> Escaped
  • <%- %> Raw
  • <%# %> Comment

Not supported

  • <% %> Evaluate
  • All other features of ejs

Usage

  • template.ejs
<body>
  <h1>hello, <%= name %>!</h1>
  <%# Example comment %>
</body>
  • index.ts
import { cwd, stdout, copy } from 'deno';
import { render } from 'https://syumai.github.io/dpl/dpl.ts';

(async () => {
  const output = await render(`${cwd()}/template.ejs`, {
    name: 'world',
  });
  await copy(stdout, output);
})();
  • console
$ deno index.ts
<body>
    <h1>hello, world!</h1>
</body>

Author

syumai

License

MIT