html-express-js 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Features
4
4
 
5
- - Serves HTML documents using template literals + Lit
5
+ - Serves HTML documents using template literals
6
6
  - Supports includes in served HTML documents
7
7
 
8
8
  ## Installation
package/example/app.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import express from 'express';
2
2
  import { resolve } from 'path';
3
- import litExpress from '../src/index.js';
3
+ import htmlExpress from '../src/index.js';
4
4
 
5
5
  const __dirname = resolve();
6
6
 
@@ -8,7 +8,7 @@ const app = express();
8
8
 
9
9
  app.engine(
10
10
  'js',
11
- litExpress({
11
+ htmlExpress({
12
12
  includesDir: 'includes',
13
13
  notFoundView: '404/index',
14
14
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "html-express-js",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "An Express template engine to render HTML views using native JavaScript",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -14,7 +14,7 @@
14
14
  "url": "git+https://github.com/markcellus/html-express-js.git"
15
15
  },
16
16
  "keywords": [
17
- "lit",
17
+ "html",
18
18
  "express",
19
19
  "views",
20
20
  "template",
package/src/index.js CHANGED
@@ -24,14 +24,11 @@ async function renderHtmlFileTemplate(path, data, state) {
24
24
  }
25
25
 
26
26
  /**
27
- * Renders a Lit JS HTML file and adds all includes to state object.
27
+ * Renders a JS HTML file and adds all includes to state object.
28
28
  *
29
29
  * @param {string} filePath - The path to html file
30
30
  * @param {object} data - Data to be made available in view
31
- * @param {object} options - Options passed to lit express
32
- * @param {object} options.includesDir
33
- * @param {object} options.viewsDir
34
- * @param {object} options.notFoundView
31
+ * @param {object} options - Options passed to express
35
32
  * @returns {string} HTML with includes available (appended to state)
36
33
  */
37
34
  async function renderHtmlFile(filePath, data = {}, options = {}) {
@@ -76,7 +73,7 @@ export function html(strings, ...data) {
76
73
  * @param {object} [opts.notFoundView]
77
74
  * @returns {Function}
78
75
  */
79
- export default function litExpress(opts) {
76
+ export default function (opts) {
80
77
  return async (filePath, data, callback) => {
81
78
  const viewsDir = data.settings.views;
82
79
  const includePath = opts.includesDir || 'includes';