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

crsa

v1.2.0

Published

A tool allowing usage of container-relative units similar to those relative to the viewport

Readme

CRSA

A tool allowing usage of container-relative units similar to those relative to the viewport

There are a few viewport-relative units presented in CSS, such as vh, vw, vmin, and vmax. This tool makes it possible to refer to some container's dimensions with the same semantics via using auxiliary names such as ch, cw, cmin or cmax.

Note: The dimension of a container's side being referred to must be independent of the container's content, e.g. be fixed or relative to an ancestor container

Units

  • ch equals one-hundredth of the container's height
  • cw equals one-hundredth of the container's width
  • cmin equals one-hundredth of the container's lesser side
  • cmax equals one-hundredth of the container's larger side
  • cavg equals one-hundredth of a square root of the container's area

Usage

(new CRSA("#container"))
    .defineStyles({
        ".description": {
            "padding": "10cmin",
            "font-size": "10cmin",
            "font-style": "italic",
        },
        ".content": {
            "padding": "10cmin",
            "font-size": "5cmin",
        },
    });

Description

  • constructor accepts either a CSS selector string or an instance of HTMLElement
  • defineStyles() accept an object where the names of the object's items represent CSS selectors of HTML elements to apply styles to and the values of the items contain style rules to be applied. First, the element is being searched within the container and if not found, in the whole document and if not found again, the styles won't be applied. Auxiliary units ch, cw, cmin, cmax, or cavg will be converted to pixels.
  • enableAutoRefresh() defines intervals related to representation refreshment. The values are specified in milliseconds. The first argument defines the interval of reassessing container's dimensions being applied when the browser window is being resized, the second argument defines the interval of reassessment applicable in any other cases, and in both cases, the actual refreshment happens only if the container's dimensions have changed. The third argument defines the interval of unconditional refreshment practical when the container's content is meant to be changing. If some argument is assigned a number equal to or lesser than zero, the interval is being bound to the frame rate of the browser window i.e. equal to the time span between frames. The default values of the first, second and third arguments are -1, 250 and 1e+12 respectively. Auto-refresh can be disabled by calling disableAutoRefresh(). It is also possible to manually refresh the representation by calling refresh().