0.1.1 • Published 5 years ago

groomy v0.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

Groomy

A component-oriented template engine.

Install

Install via npm.

npm install groomy

Usage

const { createRenderer } = require('groomy');

// define component
const hello = `
<template>
  <span>Hello, {{name}}!</span>
  <slot></slot>
</template>
`;

// create render function with the component above
const render = createRenderer({
  components: {
    hello,
  },
});

// render a template
const html = render('<hello name="John">And good-bye....</hello>');
console.log(html.trim());
// <span>Hello, John!</span>
// And good-bye....