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

be-channeling

v0.0.31

Published

be-channeling is a web component / decorator / behavior / custom attribute. It responds to internal events of the component it adorns.

Readme

be-channeling

Playwright Tests

Size of package, including custom element behavior framework (be-decorated):

How big is this package in your project?

Size of new code in this package:

be-channeling is a web component / decorator / behavior / custom attribute. It responds to internal events of the component it adorns.

It serves a similar purpose, and shares similar syntax to be-noticed.

The difference between them is this: be-noticed, unlike be-channeling, is meant to be attached to individual elements, focusing on scenarios where there is no ambiguity about the origin of the event.

be-channeling, in contrast, is meant to be attached to elements that host lots of rapidly changing children.

The most clear-cut case for be-channeling is attaching it to a web component that sponsors a (virtual) list. There are many rotating elements inside, so it would be somewhat costly to attach event handlers on all of them.

Instead, be-channeling works with bubbling events, composed events, and captured events, and allows us to specify what actions to take by first filtering on the event based on css matching and other criteria.

<xtal-vlist be-channeling='{
            "eventFilter": "click",
            "composedPathMatch": "button",
            "fn": "myHostMethod"
        }'
>
    <template slot=row>
        <button>Click me</button>
    </template>
</xtal-vlist>

Alternative syntax [TODO]

<xtal-vlist be-channeling='
    Set event filter to click.
    Set composed path match to button.
    Set fn to my host method.
'
>
    <template slot=row>
        <button>Click me</button>
    </template>
</xtal-vlist>

... means "If the triggering element is a button, then call myHostMethod from the host".

Isn't this a violation of encapsulation, to be monitoring for events that are coming from inside the (Shadow DOM) children of an element?

Not really. As we can see in this example, the button element is part of the light children used to define the template that xtal-vlist uses.

The example above is basically the simplest example, but the syntax can scale to much larger scenarios:

  1. If more than one event type to monitor for, use an array.
  2. The eventFilter can be an object, and allows for more complex event filtering.

For example:

<xtal-vlist be-channeling='{
            "eventFilter": {
                "type": "click",
                "key": "enter",
                "shiftKey": true,
                "details":{
                    "value": "true"
                },
            },
            "composedPathMatch": "button",
            "fn": "myHostMethod"
        }
}'>
    <template slot=row>
        <button>Click me</button>
    </template>
</xtal-vlist>

No, not JSON!

The json-in-html VSCode plugin allows us to benefit from syntax color highlighting, and consequently avoid most syntax misfires, including while editing README files. It is compatible with the web versions of VSCode.

In addition, the may-it-be transpiler allows us to edit .mts/.mjs files, and it compiles the files to static HTML files, which is another way to escape the purgatory that is raw JSON editing. Using this technique, we can benefit from type checks on our attributes with no additional IDE plugins, and avoid all the non-ergonomic typing of quotes, and escaping.

Alternatively [TODO]

<xtal-vlist be-channeling='
Invoke my host method when a button emits click event with shiftKey set to true and key set to enter and where the details object has value "true".
'>
    <template slot=row>
        <button>Click me</button>
    </template>
</xtal-vlist>

Viewing Locally

  1. Install git.
  2. Fork/clone this repo.
  3. Install node.
  4. Open command window to folder where you cloned this repo.
  5. npm install

  6. npm run serve

  7. Open http://localhost:3030/demo/dev in a modern browser.

Importing in ES Modules:

import 'be-channeling/be-channeling.js';

Using from CDN:

<script type=module crossorigin=anonymous>
    import 'https://esm.run/be-channeling';
</script>