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

@area17/a17-behaviors

v0.5.1

Published

JavaScript framework to attach JavaScript events and interactions to DOM Nodes

Readme

A17 Behaviors

 

A17 Behaviors is a lightweight JavaScript framework designed to seamlessly attach behaviors — such as interactions, event listeners, and manipulations — to DOM nodes using declarative data-behavior attributes. This approach promotes modularity, code clarity, and maintainability in your front-end development.

Clearly showing an element's associated behaviors enhances discoverability. Instead of searching through lengthy JavaScript files or guessing which scripts are attached to which DOM nodes, declared behaviors let you quickly identify the relevant code and streamline your development process.

Key Features

  • Declarative binding via data-behavior
  • Lazy initialization with data-behavior-lazy when elements enter the viewport
  • Optional dynamic behavior loading (via Vite or Webpack)
  • Modular architecture that separates behavior logic
  • Automatic init/destroy of behaviors for dynamic DOM changes
  • Lifecycle events: init, resized, enabled, mediaQueryUpdated, intersectionIn, intersectionOut, disabled and destroy
  • Easily extend existing behaviors with extendBehavior
  • Built to be fast: written in vanilla JavaScript
  • Tiny filesize: 14kb minified / 4kb gzipped

Installation

Install via npm:

npm install @area17/a17-behaviors

Usage Example

<button data-behavior="showAlert">Click me</button>

With a corresponding behavior:

import { createBehavior } from '@area17/a17-behaviors';

const showAlert = createBehavior('showAlert',
    {
        alert(val) {
            window.alert('Hello world!');
        }
    },
    {
        init() {
            this.$node.addEventListener('click', this.alert);
        },
        destroy() {
            this.$node.removeEventListener('click', this.alert);
        }
    }
);

export default showAlert;

And managed from a central application.js:

import { manageBehaviors } from '@area17/a17-behaviors';
import showAlert from './behaviors/showAlert';

document.addEventListener('DOMContentLoaded', () => {
    manageBehaviors.init({
        showAlert
    });
});

In this example, clicking the button will trigger an alert saying "Hello world!".

How It Works

manageBehaviors uses MutationObserver, IntersectionObserver, and a debounced resize listener to track DOM changes. It detects when elements are added, removed, or enter/exit the viewport and triggers lifecycle methods on attached behaviors.

createBehavior defines a behavior, giving you a logical structure with clearly scoped methods and lifecycle hooks tied to specific DOM nodes.

extendBehavior lets you create variations of an existing behavior by overriding or adding properties and methods.

Wiki

See the Wiki for:

  • Full API reference
  • Advanced usage (dynamic content, lazy-loading behaviors)
  • FAQ and troubleshooting
  • Best practices

Browser Support

Usage of MutationObserver and IntersectionObserver requires support of browsers from 2019 onwards.

License

MIT

Contribution

Code of Conduct

AREA 17 is dedicated to building a welcoming, diverse, safe community. We expect everyone participating in the AREA 17 community to abide by our Code of Conduct. Please read it. Please follow it.

Bug reports and features submission

To submit an issue or request a feature, please do so on Github.

If you file a bug report, your issue should contain a title and a clear description of the issue. You should also include as much relevant information as possible and a code sample that demonstrates the issue. The goal of a bug report is to make it easy for yourself - and others - to replicate the bug and develop a fix.

Remember, bug reports are created in the hope that others with the same problem will be able to collaborate with you on solving it. Do not expect that the bug report will automatically see any activity or that others will jump to fix it. Creating a bug report serves to help yourself and others start on the path of fixing the problem.

Versioning scheme

Our A17 Behaviors follows Semantic Versioning. Major releases are released only when breaking changes are necessary, while minor and patch releases may be released as often as every week. Minor and patch releases should never contain breaking changes.

When referencing A17 Behaviors from your application, you should always use a version constraint such as ^1.0, since major releases of A17 Behaviors will include breaking changes.