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

yg-vanilla-js-helpers

v5.0.0

Published

A custom grid system and a stats overlay. For vanilla JS projects

Readme

Vanilla JS Helpers

A collection of vanilla JavaScript utilities: a grid system and a stats overlay.

Features

  • Stats Overlay: Displays viewport dimensions, aspect ratio, and FPS
  • Grid System: CSS grid with a development overlay
  • No dependencies: JavaScript and CSS only
  • ES Modules: Module system support
  • Dark mode: Responds to prefers-color-scheme

Installation

npm install yg-vanilla-js-helpers

Quick Start

import { grid, stats } from 'yg-vanilla-js-helpers';

document.addEventListener('DOMContentLoaded', () => {
  grid.init();
  stats.init();
});

Grid System

CSS grid layout with a toggleable development overlay.

Methods

  • grid.init(options) - Initialize the grid
    • options.show (boolean): Show overlay on init
    • options.columnsColor (string): Column background color
    • options.columnsBorderColor (string): Column border color
    • options.columnsBorderWidth (string): Column border width
    • options.columnsBorderStyle (string): Column border style
    • options.zIndex (number): z-index applied to the grid overlay
  • Returns a cleanup function

Breakpoints

| Prefix | Breakpoint | Active at | |--------|-----------|-----------| | (none) | — | always | | sm- | 576px | < 576px only | | md- | 768px | ≥ 576px and up | | lg- | 992px | ≥ 768px and up | | xl- | 1200px | ≥ 992px and up | | xxl- | 1440px | ≥ 1200px and up |

The grid uses 4 columns below 576px, 8 columns from 576px, and 12 columns from 768px.

Responsive Column Behavior

Prefixed column classes use min-width semantics: md-col-* applies from its breakpoint upward until a larger-breakpoint class overrides it. A higher-breakpoint class always wins regardless of class order in the HTML attribute.

<!-- col-12 on mobile, 4 cols on tablet, 3 cols on desktop -->
<div class="col-12 md-col-4 lg-col-3">...</div>

<!-- identical result — class order in HTML doesn't matter -->
<div class="lg-col-3 col-12 md-col-4">...</div>

CSS Classes

/* Container */
.container

/* Columns (always applied) */
.col-1 to .col-12

/* Responsive columns */
.sm-col-1 to .sm-col-4    /* < 576px only */
.md-col-1 to .md-col-8    /* ≥ 576px and up */
.lg-col-1 to .lg-col-12   /* ≥ 768px and up */

/* Offsets (always applied) */
.offset-1 to .offset-12

/* Responsive offsets */
.sm-offset-1 to .sm-offset-4    /* < 576px only */
.md-offset-1 to .md-offset-8    /* ≥ 576px and up */
.lg-offset-1 to .lg-offset-12   /* ≥ 768px and up */

/* Sub-grids */
.sub-grid
.sm-sub-grid    /* < 576px only */
.md-sub-grid    /* ≥ 576px and up */
.lg-sub-grid    /* ≥ 768px and up */

Example

grid.init({
  show: true,
  columnsColor: 'rgba(255, 0, 0, 0.1)',
  columnsBorderColor: 'red',
  columnsBorderWidth: '1px',
  columnsBorderStyle: 'dashed'
});
<div class="container">
  <div class="col-6">Half width</div>
  <div class="col-6">Half width</div>
</div>

Stats Overlay

Development overlay showing viewport and performance data.

Methods

  • stats.init(options) - Initialize the stats overlay
    • options.show (boolean): Show overlay on init
    • options.zIndex (number): z-index applied to the stats overlay
  • Returns a cleanup function

Displays

  • Viewport dimensions
  • Aspect ratio
  • FPS counter

CSS Variables

:root {
  --background-color: #ebecd6;
  --foreground-color: #0a100d;
  --accent-color: #3066be;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background-color: #0a100d;
    --foreground-color: #ebecd6;
    --accent-color: #3066be;
  }
}

Keyboard Shortcuts

  • Alt + G — Toggle grid overlay
  • Alt + S — Toggle stats overlay

Project Structure

yg-vanilla-js-helpers/
├── index.js
├── script/
│   ├── grid.js
│   └── stats.js
├── dist/
│   └── styles/
└── scss/

License

ISC

Author

Yassine Gallaoui