1.9.0 • Published 7 years ago

fast-ftl v1.9.0

Weekly downloads
96
License
-
Repository
-
Last release
7 years ago

中文 README

Process

npm.io

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 为单位
});
propertyFast-FTLdefaultValue
default_encodingdefaultEncodingutf-8
url_escaping_charseturlEscapingCharsetSetutf-8
number_formatnumberFormat0.##########
template_update_delay(Milliseconds)templateUpdateDelay0

Step 3 - Parse file

render.parse("test.ftl", {
    YourName: "Jack"
}).then(data => {
    console.log(data);
}).catch(e => {
    console.log(e)
});

Features

  1. Fast: use Socket to invoke Java Freemarker Parser, not in Teminal.
  2. Support MultiTemplate Directory.
  3. Simple API, base on Promise.

Contributors

君羽💻 🔌 🚇 📖 ⚠️ 🐛 💡carryxyh💻

LICENSE

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