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

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    49
    • latest

Version History

Package Sidebar

Install

npm i @prairielearn/html-ejs

Weekly Downloads

104

Version

2.0.0

License

none

Unpacked Size

10.9 kB

Total Files

14

Last publish

Collaborators

  • nwalters512
  • mwest1066