ecto 4.2.1 → 4.2.3
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 +9 -15
- package/dist/ecto.d.ts +5 -0
- package/dist/ecto.js +5 -0
- package/package.json +11 -23
package/README.md
CHANGED
|
@@ -12,9 +12,16 @@
|
|
|
12
12
|
|
|
13
13
|
Ecto is a modern template consolidation engine that enables the best template engines: EJS, Markdown, Pug, Nunjucks, Mustache, Handlebars, and Liquid. It consolidates these template engines to a single library, allowing you to use any of them with ease.
|
|
14
14
|
|
|
15
|
+
# Features
|
|
16
|
+
|
|
17
|
+
* Zero Config by default but all properties exposed for flexibility. Check out our easy [API.](#api)
|
|
18
|
+
* Async `render` and `renderFromFile` functions for ES6 and Typescript.
|
|
19
|
+
* [Render via Template File](#render-from-file) with Automatic Engine Selection. No more selecting which engine to use, engine choice is automatically decided based on the file extension.
|
|
20
|
+
* [Only the Top Template Engines](#only-the-top-template-engines-and-their-extensions): EJS, Markdown, Pug, Nunjucks, Mustache, Liquid, and Handlebars.
|
|
21
|
+
* FrontMatter Helpers `.hasFrontMatter`, `.getFrontMatter`, and `.removeFrontMatter` for Markdown files.
|
|
22
|
+
* Maintained with Monthly Updates!
|
|
23
|
+
|
|
15
24
|
# Table of Contents
|
|
16
|
-
* [Features](#features)
|
|
17
|
-
* [ESM and Node Version Support](#esm-and-node-version-support)
|
|
18
25
|
* [Getting Started](#getting-started)
|
|
19
26
|
* [Only the Top Template Engines and Their Extensions](#only-the-top-template-engines-and-their-extensions)
|
|
20
27
|
* [API - Methods and Parameters](#api---methods-and-parameters)
|
|
@@ -35,19 +42,6 @@ Ecto is a modern template consolidation engine that enables the best template en
|
|
|
35
42
|
* [How to Contribute](#how-to-contribute)
|
|
36
43
|
* [License](#license)
|
|
37
44
|
|
|
38
|
-
# Features
|
|
39
|
-
|
|
40
|
-
* Zero Config by default but all properties exposed for flexibility. Check out our easy [API.](#api)
|
|
41
|
-
* Async `render` and `renderFromFile` functions for ES6 and Typescript.
|
|
42
|
-
* [Render via Template File](#render-from-file) with Automatic Engine Selection. No more selecting which engine to use, engine choice is automatically decided based on the file extension.
|
|
43
|
-
* [Only the Top Template Engines](#only-the-top-template-engines-and-their-extensions): EJS, Markdown, Pug, Nunjucks, Mustache, Liquid, and Handlebars.
|
|
44
|
-
* FrontMatter Helpers `.hasFrontMatter`, `.getFrontMatter`, and `.removeFrontMatter` for Markdown files.
|
|
45
|
-
* Maintained with Monthly Updates!
|
|
46
|
-
|
|
47
|
-
# ESM and Node Version Support
|
|
48
|
-
|
|
49
|
-
This package is ESM only and tested on the current lts version and its previous. Please don't open issues for questions regarding CommonJS / ESM or previous Nodejs versions. To learn more about using ESM please read this from `sindresorhus`: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
|
|
50
|
-
|
|
51
45
|
# Getting Started
|
|
52
46
|
|
|
53
47
|
The [Node.js package manager documentation](https://nodejs.org/en/download/package-manager/) provides the commands needed to complete the install on Windows and other operating systems.
|
package/dist/ecto.d.ts
CHANGED
|
@@ -99,9 +99,14 @@ declare class Ecto {
|
|
|
99
99
|
private readonly __nunjucks;
|
|
100
100
|
private readonly __handlebars;
|
|
101
101
|
private readonly __liquid;
|
|
102
|
+
/**
|
|
103
|
+
* Ecto constructor
|
|
104
|
+
* @param {EctoOptions} [options] - The options for the ecto engine
|
|
105
|
+
*/
|
|
102
106
|
constructor(options?: EctoOptions);
|
|
103
107
|
/**
|
|
104
108
|
* Get the default engine
|
|
109
|
+
* @returns {string} - the engine name such as 'ejs', 'markdown', 'pug', 'nunjucks', 'handlebars', 'liquid'
|
|
105
110
|
*/
|
|
106
111
|
get defaultEngine(): string;
|
|
107
112
|
/**
|
package/dist/ecto.js
CHANGED
|
@@ -299,6 +299,10 @@ var Ecto = class {
|
|
|
299
299
|
__nunjucks;
|
|
300
300
|
__handlebars;
|
|
301
301
|
__liquid;
|
|
302
|
+
/**
|
|
303
|
+
* Ecto constructor
|
|
304
|
+
* @param {EctoOptions} [options] - The options for the ecto engine
|
|
305
|
+
*/
|
|
302
306
|
constructor(options) {
|
|
303
307
|
this.__ejs = new EJS(options?.engineOptions?.ejs);
|
|
304
308
|
this.__markdown = new Markdown(options?.engineOptions?.markdown);
|
|
@@ -314,6 +318,7 @@ var Ecto = class {
|
|
|
314
318
|
}
|
|
315
319
|
/**
|
|
316
320
|
* Get the default engine
|
|
321
|
+
* @returns {string} - the engine name such as 'ejs', 'markdown', 'pug', 'nunjucks', 'handlebars', 'liquid'
|
|
317
322
|
*/
|
|
318
323
|
get defaultEngine() {
|
|
319
324
|
return this.__defaultEngine;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ecto",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.3",
|
|
4
4
|
"description": "Modern Template Consolidation Engine for EJS, Markdown, Pug, Nunjucks, Liquid, and Handlebars",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/ecto.js",
|
|
@@ -18,11 +18,10 @@
|
|
|
18
18
|
"author": "Jared Wray <me@jaredwray.com>",
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"scripts": {
|
|
21
|
-
"watch": "tsc -w -p .",
|
|
22
21
|
"clean": "rimraf ./dist yarn.lock package-lock.json pnpm-lock.yaml ./coverage ./node_modules ./site/readme.md ./dist-site",
|
|
23
22
|
"test": "xo --fix && vitest run --coverage",
|
|
24
23
|
"build": "rimraf ./dist && tsup src/ecto.ts --format esm --dts --clean",
|
|
25
|
-
"prepare": "
|
|
24
|
+
"prepare": "pnpm build",
|
|
26
25
|
"website:build": "rimraf ./site/readme.md && npx -y docula build -s ./site -o ./dist-site",
|
|
27
26
|
"website:serve": "rimraf ./site/readme.md && npx -y docula serve -s ./site -o ./dist-site"
|
|
28
27
|
},
|
|
@@ -47,43 +46,32 @@
|
|
|
47
46
|
"liquidjs"
|
|
48
47
|
],
|
|
49
48
|
"dependencies": {
|
|
50
|
-
"@jaredwray/fumanchu": "^3.0.
|
|
49
|
+
"@jaredwray/fumanchu": "^3.0.4",
|
|
51
50
|
"ejs": "^3.1.10",
|
|
52
51
|
"liquidjs": "^10.21.0",
|
|
53
52
|
"nunjucks": "^3.2.4",
|
|
54
53
|
"pug": "^3.0.3",
|
|
55
54
|
"underscore": "^1.13.7",
|
|
56
|
-
"writr": "^4.4.
|
|
55
|
+
"writr": "^4.4.3"
|
|
57
56
|
},
|
|
58
57
|
"devDependencies": {
|
|
59
58
|
"@types/ejs": "^3.1.5",
|
|
60
|
-
"@types/
|
|
61
|
-
"@types/node": "^22.13.9",
|
|
59
|
+
"@types/node": "^22.15.17",
|
|
62
60
|
"@types/nunjucks": "^3.2.6",
|
|
63
61
|
"@types/pug": "^2.0.10",
|
|
64
62
|
"@types/underscore": "^1.13.0",
|
|
65
|
-
"@vitest/coverage-v8": "^3.
|
|
66
|
-
"docula": "^0.
|
|
63
|
+
"@vitest/coverage-v8": "^3.1.3",
|
|
64
|
+
"docula": "^0.11.1",
|
|
67
65
|
"rimraf": "^6.0.1",
|
|
68
66
|
"tsup": "^8.4.0",
|
|
69
|
-
"typescript": "^5.8.
|
|
70
|
-
"vitest": "^3.
|
|
71
|
-
"webpack": "^5.
|
|
67
|
+
"typescript": "^5.8.3",
|
|
68
|
+
"vitest": "^3.1.3",
|
|
69
|
+
"webpack": "^5.99.8",
|
|
72
70
|
"xo": "^0.60.0"
|
|
73
71
|
},
|
|
74
|
-
"xo": {
|
|
75
|
-
"ignores": [
|
|
76
|
-
"vitest.config.mjs"
|
|
77
|
-
]
|
|
78
|
-
},
|
|
79
72
|
"files": [
|
|
80
73
|
"dist",
|
|
81
74
|
"bin",
|
|
82
75
|
"LISCENSE"
|
|
83
|
-
]
|
|
84
|
-
"pnpm": {
|
|
85
|
-
"onlyBuiltDependencies": [
|
|
86
|
-
"esbuild"
|
|
87
|
-
]
|
|
88
|
-
}
|
|
76
|
+
]
|
|
89
77
|
}
|