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

@jaisocx/template-renderer

v1.6.2

Published

`@jaisocx/template-renderer` > 💡 The package does ...

Downloads

12

Readme

Template Renderer

@jaisocx/template-renderer

💡 The package does ...

status

✅ Ok

supports

Client Side

   Browser |   Express |   Console 
    ✅ yes |      ❌ no |     ❌ no 

📅 Updated

Winter 2026

Library: @jaisocx/template-renderer ver. 1.6.1

🗓 timestamp: Tue Jan 20 06:28:29 CET 2026


size

109 KB

  Current Folder |   This lib installed        |   typescript in src/  
                 |     in other node_modules/  |                       
          109 KB |                             |                5 KB   

💡 The aim of the setup

The package does ...

  
  import { TemplateRenderer } from "@jaisocx/template-renderer";
  import { EventHandlerReturnValue } from "@jaisocx/event-emitter";
  
  export class ExampleTemplateRenderer {
    TemplateRenderer: TemplateRenderer;
  
    holderHtmlNodeSelector: any|null;
  
    data: object;
  
    template: any;
  
    constructor() {
      this.data = {
        message: "Hello World!",
      };
      this.template = `
  <h3>{{ message }}</h3>      
        `;
  
      this.TemplateRenderer = new TemplateRenderer();
      this.holderHtmlNodeSelector = null;
    }
  
    run(): void {
      let holderHtmlNode: HTMLElement|null = null;
      if (!this.holderHtmlNodeSelector) {
        this.holderHtmlNodeSelector = "body";
      }
      holderHtmlNode = document.querySelector(this.holderHtmlNodeSelector);
      if (!holderHtmlNode) {
        return;
      }
  
      this.TemplateRenderer
        .setTemplate(this.template)
        .setData(this.data);
  
      const eventHandler1: any = ( eventName: any, payload: any ) => {
        payload.html = payload.html.replaceAll(
          "<", 
          "&lt;");
    
        const eventHandlerReturnValue: EventHandlerReturnValue = new class implements EventHandlerReturnValue {
          payloadReturned: any = payload;
          value: any = "";
        }();
    
        return eventHandlerReturnValue;
      };
    
      this.TemplateRenderer.addThisClassEventListener (
        this.TemplateRenderer.EVENT_NAME__AFTER_RENDER,
        eventHandler1
      );
  
      const eventHandler2: any = ( eventName: any, payload: any ) => {
        payload.html = payload.html.replaceAll(
          ">", 
          "&gt;");
  
        const eventHandlerReturnValue: EventHandlerReturnValue = new class implements EventHandlerReturnValue {
          payloadReturned: any = payload;
          value: any = "";
        }();
  
        return eventHandlerReturnValue;
      };
  
      this.TemplateRenderer.addThisClassEventListener (
        this.TemplateRenderer.EVENT_NAME__AFTER_RENDER,
        eventHandler2
      );
  
      const html = this.TemplateRenderer.render();
  
      holderHtmlNode.insertAdjacentHTML (
        "afterbegin",
        html
      );
  
    }
  }

index.html


  <html>
    <head>
      <title>TemplateRenderer Example</title>
    </head>
    <body>
  
      <script src="packages/EventEmitter/transpiled/Simple/EventEmitter.js"></script>
      <script src="packages/TemplateRenderer/transpiled/Simple/TemplateRenderer.js"></script>
    
      <script src="webpack_builds/ExampleTemplateRenderer/transpiled/Simple/ExampleTemplateRenderer.js"></script>
      <script>
        document.addEventListener('DOMContentLoaded', () => {
          const example = new ExampleTemplateRenderer();
          example.run();
        });
      </script>
    </body>
  </html>

💡 The aim of the setup

The very lightweight class to populate an html template with values from a js object or json.

The template has just one placeholder available, like this: {{ someValueFromJson }}.

  
  const data: any = {
    "message": "Hello World!"
  }
  
  const template: any = "<h3>{{ message }}</h3>";
  
  const templateRenderer: TemplateRenderer = new TemplateRenderer();
  const html: any = templateRenderer
    .setTemplate(template)
    .setData(data)
    .render();

Have a nice day.

Elias, Software Architect of Jaisocx Company