$ npm install rendy
Simple template engine compatible with handlebars and mustache.
npm i rendy
In ESM
import rendy from 'rendy';
in CommonJS:
const rendy = require('rendy');
Values
is:
type Values = {
[key: string]: unknown;
};
type Modifiers = {
[key: string]: (value: unknown) => string;
};
rendy('hello {{ value }}', {
value: 'world',
});
// returns
'hello world';
const values = {
names: ['a', 'b', 'c'],
};
const modifiers = {
implode: (a) => a.join(', '),
};
rendy('hello {{ names | implode }}', values, modifiers);
// returns
'hello a, b, c';
MIT
© 2010 - cnpmjs.org x YWFE | Home | YWFE