1.9.0 • Published 7 years ago
fast-ftl v1.9.0
Process
How to use
npm i fast-ftl -S
Step 1 - Import
1. Import in es2015+
import Render from "fast-ftl";
2. Require in CommonJS
const {Render} = require("fast-ftl");
or
var Render = require("fast-ftl").Render;
Step 2 - Init Fast-FTL
var render = Render({
root: path.join(__dirname, 'pages'),
paths: [
path.join(__dirname, 'common')
], // Support MultiTemplateLoader
defaultEncoding: "utf-8", // 默认 encoding
urlEscapingCharsetSet: "utf-8", // URLEscapingCharset
numberFormat: "0.##########", // 数字格式化方式
templateUpdateDelay: 0 // milliseconds 为单位
});
property | Fast-FTL | defaultValue |
---|---|---|
default_encoding | defaultEncoding | utf-8 |
url_escaping_charset | urlEscapingCharsetSet | utf-8 |
number_format | numberFormat | 0.########## |
template_update_delay(Milliseconds) | templateUpdateDelay | 0 |
Step 3 - Parse file
render.parse("test.ftl", {
YourName: "Jack"
}).then(data => {
console.log(data);
}).catch(e => {
console.log(e)
});
Features
- Fast: use Socket to invoke Java Freemarker Parser, not in Teminal.
- Support MultiTemplate Directory.
- Simple API, base on Promise.
Contributors
君羽💻 🔌 🚇 📖 ⚠️ 🐛 💡 | carryxyh💻 |
---|
LICENSE
1.9.0
7 years ago
1.8.3
7 years ago
1.7.2
7 years ago
1.8.2
7 years ago
1.8.1
7 years ago
1.8.0
7 years ago
1.8.0-0
7 years ago
1.7.1
7 years ago
1.7.0
7 years ago
1.6.3
7 years ago
1.6.2
7 years ago
1.6.1
7 years ago
1.6.0
7 years ago
1.5.0
7 years ago
1.4.1
7 years ago
1.4.0
7 years ago
1.3.0
7 years ago
1.2.0
7 years ago
1.1.9
7 years ago
1.1.8
7 years ago
1.1.7
7 years ago
1.1.6
7 years ago
1.1.5
7 years ago
1.1.4
7 years ago
1.1.3
7 years ago
1.1.2
7 years ago
1.1.1
7 years ago
1.1.0
7 years ago
1.0.0
7 years ago
0.1.1
7 years ago
0.1.0
7 years ago