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

@adobe/helix-rum-enhancer

v2.26.0

Published

Helix RUM Enhancer

Downloads

25,407

Readme

Helix RUM Enhancer

Add advanced functionality to Helix RUM Collection (client-side)

Status

codecov GitHub Actions GitHub license GitHub issues semantic-release

Usage

This library is meant to be used in conjunction with and loaded by the sampleRUM function found in Helix Project Boilerplate or Helix RUM JS.

It will add following new checkpoints:

  • cwv: Core Web Vitals Collection
  • pagesviewed: number that helps to estimate how many pages are seen in average by a user.
  • click: A click anywhere in the document
  • viewblock: A Helix block has been scrolled into the viewport
  • viewmedia: An image or video hosted by Helix Media Bus has been scrolled into the viewport
  • reload, navigate, enter: depending on how the current page was accessed
  • formsubmit: when a form is submitted

The source parameter and the sourceSelector

The source parameter is a string that can be used to identify the source of the event. It can be used to identify the source of the event, e.g. a button, a link, a form, etc. It represents an idealized CSS selector that is both human-readable and specific enough to identify the source of the event in the document, even when not having access to the orginal document. It is idealized because it pretends the DOM would use modern HTML with concise semantics, even if the actual document uses class values for things that would be better represented by semantic HTML elements.

The sourceSelector function is a function that takes a DOM element and returns a descriptive source parameter. If the element has a data-rum-source attribute, its value is used as the source parameter. Otherwise, the function tries to generate a source parameter based on the element's tag name, class names, and text content.

The structure of the source parameter is as follows:

<context> <element>#<identifier>

All three parts are optional

context is

  • form for form elements
  • dialog for dialog elements, or parent containers that are fixed positioned and have a positive high z-index
  • .block-name for Helix blocks
  • header, footer, nav, aside for main site structure
  • #id as a fallback, if a container ID is available

element is

  • button for buttons, or links that look like buttons (e.g. with a class button or btn or cta)
  • img for images
  • video for videos
  • a for links that are not buttons
  • input[type="text"] for input elements (all types are supported)
  • select, textarea, etc. for other form elements

identifier is

  • the id attribute of the element, if provided
  • the first .class if there are any
  • else omitted

Even if an identifier is provided, having a context and element is recommended, as it makes the source parameter more readable and easier to understand.

Examples

  • ``

Development

Build

$ npm install

Test

$ npm test

Lint

$ npm run lint