1.9.0 • Published 8 years ago
fast-ftl v1.9.0
Process
How to use
npm i fast-ftl -SStep 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
8 years ago
1.8.3
8 years ago
1.7.2
8 years ago
1.8.2
9 years ago
1.8.1
9 years ago
1.8.0
9 years ago
1.8.0-0
9 years ago
1.7.1
9 years ago
1.7.0
9 years ago
1.6.3
9 years ago
1.6.2
9 years ago
1.6.1
9 years ago
1.6.0
9 years ago
1.5.0
9 years ago
1.4.1
9 years ago
1.4.0
9 years ago
1.3.0
9 years ago
1.2.0
9 years ago
1.1.9
9 years ago
1.1.8
9 years ago
1.1.7
9 years ago
1.1.6
9 years ago
1.1.5
9 years ago
1.1.4
9 years ago
1.1.3
9 years ago
1.1.2
9 years ago
1.1.1
9 years ago
1.1.0
9 years ago
1.0.0
9 years ago
0.1.1
9 years ago
0.1.0
9 years ago