tripartite
v1.1.6
Published
A simple and fast javascript templating library
Readme
Tripartite
A micro templating tool.
Install
npm install tripartiteUsage
Include a template directly in a client side script by adding to the package.json:
"browserify": {
"transform": [
"tripartite/browserify-transform"
]
}or in a webpack config like:
let pagesConf = {
entry: './source.js',
output: {
filename: 'output.js',
path: path.resolve(__dirname, 'public/js'),
},
module: {
rules: [
{ test: /\.tmpl$/, use: 'tripartite/webpack-loader.mjs' }
, { test: /\.tri$/, use: 'tripartite/webpack-loader.mjs' }
, { test: /\.txt$/i, use: 'raw-loader' }
],
}
}This adds the template to the global tripartite instance and returns the parsed and runnable template function.
To load and use a template directly, you can run:
let template = require('./template.tri')