Skip to content

megazear7/jtl

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 

JTL

JSON Templating Language

Visit the documenation at jtl.alexlockhart.me or visit us on NPM.

JTL allows you to convert properly formatted json into html. What you do with that html is up to you.

Usage

JTL is provided in esm, umd, and cjs formats all with minified versions. The below example uses the esm format.

npm install @megazear7/jtl
import { jtl } from '@megazear7/jtl';

const json = {
    name: "html",
    attr: {
        "lang": "en"
    },
    children: [
        { name: "head" },
        {
            name: "body",
            children: [
                { name: "h1", content: "Hello, World!" }
            ]
        }
    ]
}

const html = jtl(json).toHtmlString();

This will output the following html:

<html lang="en">
   <head></head>
   <body>
      <h1>Hello, World!</h1>
   </body>
</html>

Features that needed added

  1. Event listeners

Contribute

Test

npm run test

Build

npm run build

Support

Buy me a coffee

Patreon

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published