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

1.1.19 • 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(__filename, "<%- include('./hello'); %>", { name: 'Anjali' })}</div>
  `.toString(),
);

Readme

Keywords

none

Package Sidebar

Install

npm i @prairielearn/html-ejs

Weekly Downloads

3

Version

1.1.19

License

none

Unpacked Size

9.34 kB

Total Files

13

Last publish

Collaborators

  • nwalters512
  • mwest1066