# meta-templater **Repository Path**: mirrors_TrySound/meta-templater ## Basic Information - **Project Name**: meta-templater - **Description**: node.js custom template parser - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-26 - **Last Updated**: 2026-01-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # meta-templater [](https://gitter.im/TrySound/meta-templater?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) Flexible templates parser inspired by [gulp-file-include](https://github.com/coderhaoxin/gulp-file-include). ## Installation ``` $ npm i meta-templater ``` ## Theory Template has three types of constructions: ### var `//= var_name` Where `//=` is prefix and suffix is empty ### fn `//= include[]` Where `include` is `fn` name and `[]` is argument js object (array) ### op `//= print ( content )` `//= each[] ()` Where arguments is optinal and `()` is body of `op` ## Initialize compile.js ```js var MT = require('meta-templater'), fs = require('fs'); var result = new MT().build(fs.readFileSync('src/index.html', 'utf-8'), { param1: true, param2: 'John' }); fs.writeFileSync('dist/index.html', result, 'utf-8'); ``` ## Examples ### Condition Handler index.html ```html //= if[data.voice] (