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 🙏

© 2024 – Pkg Stats / Ryan Hefner

dombindy

v0.1.1

Published

A simple, lightweight web framework. Yes another framework. I'm tired of how bloated the popular ones are. Angular, React and Vue.

Downloads

1

Readme

DomBINDy

Welcome to DOMBindy. A new web framework written in typescript. Syntax is heavily inspired by AngularJS however this framework is designed to be as minimal as possible. Just one single JS file and you're ready to start using the templating tools right away.

This plugin is currently still in development and highly experimental. The project itself is intended for educational use only. You're welcome to check it out, or add to it as you please, but you are probably better off using one of the big names (Angular, React, VueJS +) for your production environments!

Available Directives

A list of directives and examples are provided below to get you started.

String Bind

Simple string binding a variable to your HTML tag. Any changes made to the variable are mirrored on the DOM.

<body bind-app="appData">
    <h1>
        Hello there,
        <span bind-str="name"></span>
    </h1>
</body>

<script src="dist/bundle.js"></script>
<script type="text/javascript">
    const appData = {
        name: 'Leila-codes'
    }
</script>

For-loop Bind

Similar to the classic ng-repeat this one iterates over a bound array and repeats the targeted element for each item.

<body bind-app="appData">
    <div class="card" bind-for="apps">
        <div class="card-header">
            <h6 bind-str="name"></h6>
        </div>
        <div class="card-body"></div>
        </div>
</body>

<script src="dist/bundle.js"></script>
<script type="text/javascript">
    const appData = {
        name: 'Leila-codes',
        apps: [
            {name: "Test App #1"},
            {name: "Test App #2"},
            {name: "Test App #3"}
        ]
    }
</script>

Click-handling bind

Similar to ng-click adds an onclick handler that is triggered inside your application's controller/scope.

Note: Named variables within the scope are automatically bound to the function arguments.

<body bind-app="appData">
    <div>
        <button bind-click="clicked(name)"></button>
    </div>
</body>

<script src="dist/bundle.js"></script>
<script type="text/javascript">
    const appData = {
        name: 'Leila-codes',
        clicked: (e, userName) => {
            alert(`Hello there ${userName}`)
        }
    }
</script>

Input Modeling Bind

Similar to ng-model this one is a bidirectional binding for input elements. Any text inputted is automatically set back to the variable.

<body bind-app="appData">
    <div>
        <input type="text" bind-model="username">
        <h6>
            Your username is: 
            <span bind-str="username"></span>
        </h6>
    </div>
</body>
<script src="dist/bundle.js"></script>
<script type="text/javascript">
    const appData = {
        username: ''
    }
</script>

Class binding

Similar to ng-class allows for toggling of a list of classes based on whether the expression is true or false.

<body bind-app="appData">
    <div class="card">
        <div class="card-header" bind-class="{'bg-primary': isBlue, 'bg-warning': !isBlue}">
            Hello App v1
        </div>
        <div class="card-body">
            Hello World!
        </div>
    </div>
</body>

<script src="dist/bundle.js"></script>
<script type="text/javascript">
    const appData = {
        isBlue: true
    }
    
    // Toggle the blue background every 3 seconds.
    setInterval(() => {
        window.app.scope.isBlue = !window.app.scope.isBlue;
    }, 3000)
</script>

Visibility binding

Similar to ng-if of ng-show toggles the display property on the element between none and it's previous value depending on whether the expression evaluates to true or false.

<body bind-app="appData">
    <div class="card" bind-if="shouldShow">
        <div class="card-body">
            I am now visible
        </div>
    </div>
</body>

<script src="dist/bundle.js"></script>
<script type="text/javascript">
    const appData = {
        shouldShow: true
    }
    
    // Toggle the panel visibility every 5 seconds.
    setInterval(() => {
        window.app.scope.shouldShow = !window.app.scope.shouldShow;
    }, 5000)
</script>

(Experimental) Style bindings

Similar to ng-style should evaluate the expression's value and assign it to the property configured as the style.

<body bind-app="appData">
    <div class="card" bind-style="{'background-color': bgColour}">
        <div class="card-body">
            I am now visible
        </div>
    </div>
</body>

<script src="dist/bundle.js"></script>
<script type="text/javascript">
    const appData = {
        bgColour: '#0cf'
    }
</script>