npm

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

2.0.6 • 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(),
);

Readme

Keywords

none

Package Sidebar

Install

npm i @prairielearn/html-ejs

Weekly Downloads

9

Version

2.0.6

License

none

Unpacked Size

11.9 kB

Total Files

14

Last publish

Collaborators

  • nwalters512
  • mwest1066