html-express-js
Advanced tools
Comparing version
{ | ||
"name": "html-express-js", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"description": "An Express template engine to render HTML views using native JavaScript", | ||
@@ -58,5 +58,5 @@ "main": "src/index.js", | ||
"reload": "^3.2.0", | ||
"sinon": "^20.0.0", | ||
"sinon": "^21.0.0", | ||
"typescript": "^5.4.3" | ||
} | ||
} |
@@ -8,5 +8,5 @@ /** | ||
* @param {Record<string, any>} [data] | ||
* @returns {Promise<void>} HTML with includes available (appended to state) | ||
* @returns {Promise<string>} HTML with includes available (appended to state) | ||
*/ | ||
export function renderView(filePath: string, req: import("express").Request, res: import("express").Response, data?: Record<string, any>): Promise<void>; | ||
export function renderView(filePath: string, req: import("express").Request, res: import("express").Response, data?: Record<string, any>): Promise<string>; | ||
/** | ||
@@ -13,0 +13,0 @@ * Template literal that supports string |
@@ -82,3 +82,3 @@ import { basename, extname } from 'path'; | ||
* @param {Record<string, any>} [data] | ||
* @returns {Promise<void>} HTML with includes available (appended to state) | ||
* @returns {Promise<string>} HTML with includes available (appended to state) | ||
*/ | ||
@@ -89,2 +89,3 @@ export async function renderView(filePath, req, res, data = {}) { | ||
res.send(html); | ||
return html; | ||
} | ||
@@ -91,0 +92,0 @@ |
14082
0.15%237
0.42%