@prairielearn/html-ejs
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

@prairielearn/html-ejs

Utilities for rendering EJS templates for use with the @prairielearn/html package.

If you have an EJS partial that you'd like to use inside of an html tagged template literal, you can use the renderEjs helper:

<!-- hello.ejs -->
Hello, <%= name %>!
import { html } from '@prairielearn/html';
import { renderEjs } from '@prairielearn/html-ejs';

console.log(
  html`
    <div>Hello, world!</div>
    <div>${renderEjs(import.meta.url, "<%- include('./hello'); %>", { name: 'Anjali' })}</div>
  `.toString(),
);

Dependencies (2)

Dev Dependencies (7)

Package Sidebar

Install

npm i @prairielearn/html-ejs

Weekly Downloads

73

Version

2.0.1

License

none

Unpacked Size

11 kB

Total Files

14

Last publish

Collaborators

  • nwalters512
  • mwest1066