0.1.0 • Published 4 years ago
component-decorator v0.1.0
Component Decorator
Small package for rendering html using handlebars
Create a Component
- Create a class
const Component = require("component-decorator");
// ES2022 Decorators
@Component(`<h1>{{name}}</h1>`)
class Foo {
constructor(name) {
// Write some code or leave this empty
}
}
// Render
Foo.render("Bar"); // `<h1>Bar</h1>
Decorators
@Component(content: string); // Content will be compiled to Handlebars template