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

resonantjs

v1.0.8

Published

A lightweight JavaScript framework that enables reactive data-binding for building dynamic and responsive web applications. It simplifies creating interactive UIs by automatically updating the DOM when your data changes.

Downloads

23

Readme

Resonant.js

Resonant.js is an open-source lightweight JavaScript framework that enables reactive data-binding for building dynamic and responsive web applications. It simplifies creating interactive UIs by automatically updating the DOM when your data changes.

Features

  • Reactive Data Binding: Automatically synchronize your data with the UI.
  • Dynamic List Rendering: Easily render lists that react to data changes.
  • Bidirectional Input Binding: Bind HTML input fields directly to your data model.
  • Efficient Conditional Updates: Only evaluate conditional expressions tied to specific variable changes.
  • Lightweight and Easy to Integrate: Minimal setup required to get started.

Installation

NPM

To install via NPM, use the following command:

npm i resonantjs

CDN

To use via CDN, include the following URLs in your HTML file:

<script src="https://unpkg.com/resonantjs@latest/resonant.js"></script>

Demo

Usage

Include resonant.js in your HTML file, and use the following example to understand how to integrate it into your web application.

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Resonant.js Basic Example</title>
  <script src="https://unpkg.com/resonantjs@latest/resonant.js"></script>
</head>
<body>
<h1>Resonant.js Basic Example</h1>
<div>
  <h2>Counter</h2>
  <p>Current count: <span res="counter"></span></p>
  <button onclick="counter++">Increment Counter</button>
</div>

<script>
  const resonantJs = new Resonant();
  resonantJs.add("counter", 0, true);
  //counter will instantiate the variable with name "counter"
  //0 is the initial value of the variable
  //true is optional, if true the variable will be stored in local storage
</script>
</body>
</html>

Features Overview

Core Concepts

  • res and res-prop Attributes: Bind HTML elements to your data model seamlessly.
    • res is used to identify an overarching data model.
    • res-prop links individual properties within that model to corresponding UI elements.
  • res-display Attribute: Conditionally display elements based on the data model's properties.
  • res-onclick Attribute: Triggers a function when an element is clicked, allowing for custom event handling.
  • res-onclick-remove Attribute: Removes an item from an array when the associated element is clicked.
  • res-style Attribute: Dynamically update CSS styles based on data model properties.
  • Automatic UI Updates: Changes to your JavaScript objects instantly reflect in the associated UI components, reducing manual DOM manipulation.

Advanced Features

  • Dynamic Arrays and Objects: Easily handle collections and nested objects to dynamically add or remove elements based on your data structures.
  • Event Callbacks: Register custom functions to execute whenever your data model changes.
  • Bidirectional Input Binding: Bind form input fields directly to your data, making two-way synchronization simple.
  • Optional Persistent Data: Save your data model to local storage for easy retrieval and persistence across sessions.

Other Information

  • The demo HTML file uses the Pico CSS framework for styling. You can find more information about Pico CSS here.

License

Resonant.js is released under the MIT License. You can find a copy of the MIT License in the LICENSE file included with the package.