https://github.com/devlop/kobolt
The most simple template factory in the world!
https://github.com/devlop/kobolt
factory javascript template typescript
Last synced: 13 days ago
JSON representation
The most simple template factory in the world!
- Host: GitHub
- URL: https://github.com/devlop/kobolt
- Owner: devlop
- License: mit
- Created: 2021-11-14T09:56:36.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-20T08:27:02.000Z (over 4 years ago)
- Last Synced: 2025-03-03T16:44:45.605Z (over 1 year ago)
- Topics: factory, javascript, template, typescript
- Language: JavaScript
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# kobolt
The most simple template factory in the world!
Turn any `` into a `HTMLElement` in a breeze.
# Installing
using npm
```bash
npm install @devlop/kobolt
```
# Placeholders
Kobolt can automatically replace placeholders in your template using the format `{{ placeholder }}`.
# Usage
```
{{ title }}
```
```
import kobolt from '@devlop/kobolt';
const templateElement = document.querySelector('template');
const outputElement = kobolt(templateElement, {
// pass a key value object with any placeholders that should be replaced.
'title': 'Kobolt',
'id': 'Co',
});
console.log(outputElement.outerHTML);
//
// Kobolt
//
```