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

dominusjs

v2.0.11

Published

DOMinus.js is a reactive data binding library that turn HTML irrelevant.

Readme

alt tag

DOMinus.js is a reactive data binding library that turn HTML irrelevant.

Version: 2.0.11


What this make?

Change "data" -> change "view" automagically

DIV:

<div id="element"></div>

Code:

HTML.element.html = "hello world" 

Result:

<div id="element"> hello world </div>

Code:

HTML.element.tag = "button"

Result:

<button id="element"> hello world </button>

Code:

HTML.element.onclick = "go()"

Result:

<button id="element" onclick="go()"> hello world </button> 

How use this

<script src="dominus.min.js"></script>

<script>
 
var DOM = new Dominus()
var HTML = DOM.HTML()
 
HTML.element = { 
  id: "element",
  html: "Hello World"
}
DOM.add("element", "#app")

</script>

Result: <div id="element" > Hello World </div>

How use with NPM

npm i dominusjs 
<script>
 
const Dominus = require("Dominusjs") 

var DOM = new Dominus()
var HTML = DOM.HTML()
 
HTML.element = { 
  id: "element",
  html: "Hello World"
}
DOM.add("element", "#app")

</script>

Result: <div id="element" > Hello World </div>

How create elements without reactivity

var DOM = new Dominus()
var HTML = DOM.HTML()
var h = DOM.h();

var div = h({ 
  tag: "button", 
  id: "name",
  class: "class1 class2",  
  html: "content"
})

console.log( div )

Result: 
<button id="name" class="class1 class2"> content </button>

Sandbox

https://playcode.io/180373/v2


Principles:

  • OBJECTivity
  • REACTivity
  • FAMILiarity
  • TERRITORiality

OBJECTivity

No more mixture of HTML with javascript.

All "HTML codes" are represented in a javascript object called "HTML".

The "object HTML" store all elements in a "Virtual DOM".

The "HTML codes" now interest only for browsers.

Example:

HTML.element = {
 tag: "div", 
 id: "element",  
 html: "hello"  
}

This will render this:

<div id="element"> hello </div>

To append this element to "DOM" use:

DOM.add( "element", "#app" )

The string "element" of "HTML.element".

The tag "#app" is the div to append the element.


REACTivity

Now always that propertie "HTML.myDiv" change, DOM View change automagically.

HTML.element.html = "hello world" 
// <div id="element"> hello world </div>

HTML.element.tag = "button"
// <button id="element"> hello world </button>

HTML.element.onclick = "go()"
// <button id="element" onclick="go()"> hello world </button> 

FAMILiarity

Each element can have properties: tag, id, class, style, type, html, etc;

HTML.header = {
  tag: "ul", 
  id: "header",
  class: "myClass",
  style: "color:red",   
  html: "header_content"  
}

When the property "html" receives equal name of a "HTML.element"...

Then this propertie will not be considered a "string", but a "child object".

Example:

HTML.header = {
  tag: "ul",
  id: "header",
  html: "header_content"  
}

HTML.header_content = { tag:"li", html: "0", class: "show" }

Then this:

<ul id="header"> header_content </ul>

Will be this:

<ul id="header">  
 <li id="header_content_1" class= "hide"> 0 </li>
</ul>

You can chain several elements inside others elements to create "components" and "entities".

That's Clean Code!


HTML.header_content_1 = { tag:"li", id: "header_content_1", class: "hide", html: "0"},  
HTML.header_content_2 = { tag:"ul", id: "header_content_2", html: "header_contentList" } 
HTML.header_contentList = { tag:"li", html: "1" }
HTML.header = {
 tag: "ul", 
 id: "header",
 style: "color: red",
 html: [ "header_content_1", "header_content_2" ]
}
 
DOM.add( "header", "#app" )

Result:

<div id="app">
  <ul id="header" style="color:red">
      <li id="header_content_1" class="hide">0</li>
      <ul id="header_content_2">
        <li>1</li>       
      </ul>
  </ul>
</div>

TERRITORiality

All the childs of an element receive the tag "parent" with the parent name.

HTML.child1 = { 
 html: "content"
} 
HTML.header = {
 id: "header", 
 html: "child1"
} 
DOM.add("header", "#app")

Result: 
<div id="header">
 <div parent="header">content</div>
</div>

Then, when a child is changed, parent is updated.

To remove an element:

delete HTML.child1

Methods


DOM.add( "element", "#app" )
DOM.get( "#app" )

Methods like Jquery - without reactivity

    
var $ = DOM.get

$("#id").removeClass("foo") 
$(".class").addClass("foo")   
$("body").hasClass("foo") 
$("#id").toogleClass("foo") 
$("#id").hide() 
$("#id").show() 
$("#id").val() 
$("#id").html("text") 
$("#id").append("<div>after</div>") 
$("#id").prepend("<div>before</div>") 

Methods js native

$("#input").id
$("#input").name
$("#input").classList
$("#input").children
$("#input").childNodes
$("#input").parentNode
$("#input").parentElement
$("#input").nextElementSibling
$("#input").previousElementSibling
Etc

And that is all.


Size

DOMinus: 4Kb

License

MIT

Copyright (c) Gurigraphics, 2018 - 2020.