mustache-file-cloner
v1.0.2
Published
creates clones of the source file after parsing with against mustache reference file
Readme
Mustache File Cloner
creates clones of the source file after parsing with against mustache reference file
SETUP:
npm install mustache-file-cloner -g
USAGE:
tachecloner SOURCE_FILE CSV_FILE DEST_FOLDER
SOURCE_FILE defaults to index.html
CSV_FILE defaults to data.csv
DEST_FOLDER defaults to ./clones/. You can omit ./ and the trailing slash.
Example:
tachecloner
tachecloner index.html vars.csv clones
tachecloner -d index.html -m vars.csv -d clonesCSV format:
id will be used to generate suffixes in filenames var_name is a needle to be searched for, encapsulated inside of mustache tags
| id | var_name | var_name_2 | |-----|----------|------------| | aaa | value 1 | value 4 | | bbb | value 2 | value 5 | | ccc | value 3 | value 6 |
Source file example:
<!DOCTYPE html>
<html>
<head>
<title>{{var_name}}</title>
</head>
<body>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum eu venenatis ante.
{{var_name_2}}
Nam nec magna finibus lorem bibendum pellentesque.
</p>
</body>
</html>