rendy

simplest template engine

MIT 22 个版本
安装
npm install rendy
yarn add rendy
pnpm add rendy
bun add rendy
README

Rendy License NPM version Build Status Coverage

Simple template engine compatible with handlebars and mustache.

Install

NPM\_INFO

npm i rendy

How to use?

import {rendy} from 'rendy';

API

rendy(template: string, value: Values, modifiers?: Modifiers)

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';

License

MIT

版本列表
5.0.2 2026-03-29
5.0.1 2026-03-22
5.0.0 2026-02-18
4.1.3 2023-10-12
4.1.2 2023-10-11
4.1.1 2023-10-11
4.1.0 2023-10-11
4.0.1 2023-10-11
4.0.0 2023-10-11
3.1.1 2020-09-11
3.1.0 2020-09-11
3.0.1 2019-09-06
3.0.0 2019-09-06
2.0.0 2018-04-26
1.1.1 2018-04-25
1.1.0 2015-05-21
1.0.6 2015-03-13
1.0.5 2015-03-13
1.0.4 2015-01-26
1.0.3 2015-01-26
1.0.2 2014-12-12
1.0.0 2014-12-12