项目作者: EvandroLG

项目描述 :
Server-side solution to insert variables into HTML
高级语言: JavaScript
项目地址: git://github.com/EvandroLG/node-simple-template.git
创建时间: 2019-01-20T21:09:26Z
项目社区:https://github.com/EvandroLG/node-simple-template

开源协议:

下载


node-simple-template

Solution to insert variables into HTML.

Installation

  1. $ npm install node-simple-template

How does it work?

node-simple-template is a simple command line tool which makes easy insert variables into HTML files.
It accepts three parameters: -f (file), -c (config file with the variables) and -d (directory where you will create the new html).

The template should contain the variables within two curly braces, for example {{myVariable}}.

To you use node-simple-template, run the following command in your terminal, passing the correct values:

  1. $ node-simple-template -f YOUR_FILE.html -c YOUR_CONFIG.json -d YOUR_DIST

Then, simple-template will create a new file based on the file which you provided per parameter and will replace the variables with the values taken from the configuration file. The new file will be created in the directory you passed by parameter.