4.1.3 • Published 7 months ago

rendy v4.1.3

Weekly downloads
3,296
License
MIT
Repository
github
Last release
7 months ago

Rendy License NPM version Build Status Coverage

Simple template engine compatible with handlebars and mustache.

Install

NPM_INFO

npm i rendy

How to use?

In ESM

import rendy from 'rendy';

in CommonJS:

const rendy = require('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

4.1.3

7 months ago

4.1.0

7 months ago

4.0.1

7 months ago

4.0.0

7 months ago

4.1.2

7 months ago

4.1.1

7 months ago

3.1.1

4 years ago

3.1.0

4 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.0.0

6 years ago

1.1.1

6 years ago

1.1.0

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.0

9 years ago