Socket
Socket
Sign inDemoInstall

rendy

Package Overview
Dependencies
0
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rendy

simplest template engine


Version published
Weekly downloads
3.7K
increased by5.17%
Maintainers
1
Install size
8.55 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 12 Oct 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc