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

databinder-lite

v2.0.1

Published

A lightweight library for data binding.

Readme

DataBinder Class Constructor: constructor() Description: Initializes a new instance of the DataBinder class and sets up the internal state for storing bindings.

Parameters:

None. Returns:

A new instance of the DataBinder class. _ensureArray(input) Description: Ensures that the input is returned as an array. If the input is already an array, it is returned unchanged. If not, it is wrapped in an array.

Parameters:

input (any): The input value to be checked. Returns:

Array: An array containing the input value. _updateElement(target, value) Description: Updates the content of an HTML element based on its tag name. It handles multiple HTML tags such as DIV, SPAN, INPUT, LI, and P. If the target is of a different type, a warning is logged.

Parameters:

target (HTMLElement): The HTML element to update. value (string): The value to update the target element with. Returns:

None. bindOneWay({ source, target, propName = null }) Description: Creates a one-way binding between a source object and a target element. Any change in the source object automatically updates the target elements.

Parameters:

source (object): The source object to bind from. Must be a non-null object. target (HTMLElement | array): The target element(s) to bind to. This can be a single element or an array of elements. propName (string | null, optional): The property name in the target element to bind to. If not specified, the entire object is bound to the target. Returns:

Proxy: A proxy object for the source to enable tracking of changes. Throws:

TypeError: If the source is not an object or is null, or if any target is not a valid HTML element or object. bindTwoWay(inputs, outputs) Description: Creates a two-way binding between input and output elements. Changes made in one will automatically update the other.

Parameters:

inputs (HTMLElement | array): The input elements to bind. Can be a single element or an array of elements. outputs (HTMLElement | array): The output elements to bind to. Can be a single element or an array of elements. Returns:

None. updateValue(variableName, newValue) Description: Manually updates the value of a bound variable. If the variable is found in the bindings, it updates the value and triggers an update for the associated elements.

Parameters:

variableName (string): The name of the variable to update. newValue (any): The new value to assign to the variable. Returns:

None. trigger(variableName) Description: Manually triggers an update for a bound variable. This forces the associated elements to reflect the current value of the variable.

Parameters:

variableName (string): The name of the variable to trigger an update for. Returns:

None. Example Usage javascript Copier Modifier import DataBinder from 'databinder';

// Create an instance of DataBinder const binder = new DataBinder();

// One-Way Binding const dataState = { value: "Loading..." }; const display = document.getElementById('data-display');

binder.bindOneWay({ source: dataState, target: [display] });

// Two-Way Binding const usernameInput = document.getElementById('username'); const preview = document.getElementById('preview-username');

binder.bindTwoWay([usernameInput], [preview]);

// Updating a variable binder.updateValue('username', 'JohnDoe');

// Manually triggering an update binder.trigger('username');