npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

juel

v1.0.2

Published

For rendering html element from javascript object using by html template in client-side

Downloads

5

Readme

juel

For rendering html element from javascript object using by html template in client-side.

Installation

$ npm install juel

Usage


<!DOCTYPE html>
<html lang="tr">

<head>
    <meta charset="utf-8" />
</head>

<body>
    <noscript>Your browser does not support JavaScript!</noscript>

    <ul id="changeList"></ul>

    <div id="todoList"></div>

    <div id="countList"></div>

    <ul id="showScope"></ul>

    <template juel="todoList">
        <ul>Click Items {{ todoList.map(addItem) }}</ul>
    </template>

    <template juel="todoItem">
        <li><button click="{{ click }}">{{ text }}</button></li>
    </template>

    <script src="./index.build.min.js"></script>
</body>

</html>

index.js file


const juel = require('juel');

// for update global scope
function changeList(e) {
    scope.todoList = [
        { id: 1, text: "Item1", count: 0 },
        { id: 2, text: "Item2", count: 0 },
        { id: 3, text: "Item3", count: 0 },
        { id: 4, text: "Item4", count: 0 },
        { id: 5, text: "Item5", count: 0 }
    ];
}

// for update sub template element scope
function itemClick(e) {
    this.count += 1;
}

// write scope to console
function showScope(e) {
    console.log(JSON.stringify(this.toJSON()));
}

// create global scope to apply changes to the DOM
// scope objects created as a global variable are meant to be used in multiple juel
// all juel objects create the scope object if you create the scope
var scope = juel.scope({
    todoList: [
        { id: 1, text: "Item1", count: 0 },
        { id: 2, text: "Item2", count: 0 },
        { id: 3, text: "Item3", count: 0 }
    ]
});

// to read templates written to DOM
juel.template.read();

// single and multiple templates can be added from within the script
juel.template.set('scopeShowBtn', '<button click="{{click}}">Show Scope On Console</button>');
juel.template.set([
    { name: "changeListBtn", html: '<button id="changeListBtn" click="{{ click }}">Change List</button>' },
    { name: "countItem", html: '<li>{{ text }}{{ count ? " - " + count + " Time" + (count > 1 ? "s": "") + " Clicked" : "" }}</li>' },
    { name: "countList", html: '<ul>Clicked Counts {{ todoList.map(addItem) }} NOT: if not clicked, number doesnt show</ul>' }
]);


// add a single template into DOM
juel.append("#changeList", 'changeListBtn', {}, {
    click: changeList
});


// multiple sub templates for scope in template can be added to DOM
// the only difference should be create instead of append and output should be HTML
var todoListJuel = juel.append("#todoList", "todoList", scope, {
    addItem: function (todoItem) {
        return juel.create("todoItem", todoItem, {
            click: itemClick.bind(todoItem)
        }).toHTML();
    }
}).setId("todoList");
// juel.get via setId function to access the juel object
console.log(todoListJuel == juel.get("todoList"));


// you can create more than one juel for the same scope object and change the two juel objects via scope
var countListJuel = juel.append("#countList", "countList", scope, {
    addItem: function (todoItem) {
        return juel.create("countItem", todoItem).toHTML();
    }
}).setId('countList');
// juel.get via setId function to access the juel object
console.log(countListJuel == juel.get("todoList"));

// translate scope object into json type
juel.append('#showScope', 'scopeShowBtn', {}, {
    click: showScope.bind(scope)
});

index.build.js file

index.build.js file is generated from index.js with libraries like browserify or babel or parcel or webpack.

Build Sample

juel Container

If you want to write a script without container, write it into the juel tag. During append operation juel disappears.


<template juel="juelTag">
    <juel>{{ value }}</juel>
</template>

Changelog

All notable changes to this project will be documented in this file.

Changelog

Examples

Basic Usage

This example shows the most basic way of usage.

License

This software is free to use under the JosephUz. See the LICENSE file for license text and copyright information.