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

@ggds/js

v0.5.0

Published

Optional script for the Ghana Government Design System (GGDS): the phone menu and error summary focus. ES modules, no dependencies, CSP-safe.

Readme

@ggds/js

npm Licence: Apache-2.0

Documentation: ghana-gds.github.io/ggds · Get started as a developer

The small, optional script for GGDS, the Ghana Government Design System. It adds the phone menu to the header, moves focus to the error summary, counts characters, adds the Show button to password fields, opens dialogs and runs the timeout warning. Every GGDS part works without it except a dialog and the timeout warning, which need it: a dialog's opener is a link to a confirmation page, so the task still works.

ES modules, about 17 KB unminified (5 KB with gzip), no dependencies, TypeScript types included. No inline scripts, so it runs under a strict Content Security Policy (script-src 'self').

Draft, version 0.1. Changes are listed in the changelog.

Install

npm install @ggds/js

Use

With a bundler, start it once:

import { initAll } from '@ggds/js';

initAll();

Without a bundler, copy the files from the release zip and load auto.js. It runs initAll() for you:

<script type="module" src="ggds/auto.js"></script>

API

| Export | What it does | |---|---| | initAll(root?) | Enhances every GGDS part inside root (default: the whole document). Safe to call more than once, for example after adding content to the page | | initMenu(button) | Enhances one header menu button | | initErrorSummary(element) | Enhances one error summary | | initCharacterCount(field) | Enhances one character count | | initPasswordInput(field) | Adds the Show / Hide button to one password field | | initDialogOpener(link) | Makes one [data-ggds-dialog] link open its dialog | | initDialog(dialog) | Makes the [data-ggds-dialog-close] buttons in one dialog close it | | initTimeoutWarning(dialog) | Starts one timeout warning |

@ggds/js/auto runs initAll() when it loads.

Phone menu

Finds .ggds-header__menu-button[aria-controls]. The button is in the header's HTML with the hidden attribute, so without the script it stays hidden and the navigation shows as a list. With the script, below 80rem:

  • the button appears, and toggles the navigation and aria-expanded;
  • the menu opens in place and pushes the page down, so it never covers content that keyboard users could tab onto;
  • Escape closes it and returns focus to the button;
  • the menu closes when the screen grows past 80rem.

Error summary

Finds [data-ggds-module="error-summary"]. When the page loads, it moves focus to the summary, so screen-reader and keyboard users hear the errors first. The summary's links (href="#field-id") work without the script; with it, following a link also scrolls the field's label or legend into view, not only the input.

Character count

Finds [data-ggds-module="character-count"]. The limit hint becomes a count that updates as people type, and screen readers hear it when they pause.

Password input

Finds [data-ggds-module="password-input"]. Shows the hidden Show button, which switches the field between hidden and visible, says which it is to screen readers, and hides the password again when the form is sent.

Dialog

Finds [data-ggds-dialog] links. The link goes to a confirmation page without the script; with it, it opens the <dialog class="ggds-dialog"> it names as a modal. Escape and [data-ggds-dialog-close] close it, and focus goes back to the link.

Timeout warning

Finds [data-ggds-module="timeout-warning"]. Opens the warning data-ggds-warn seconds before data-ggds-timeout, counts down, requests data-ggds-keep-alive when people choose "Stay signed in" (or press Escape), and goes to data-ggds-sign-out when time runs out.

Browser support

Browsers that run ES modules: current Chrome, Edge, Firefox and Safari. Older browsers skip the script and get the version without it, which works.

Related packages

Contributing and support

Report problems and ask questions in GitHub issues, and see Contribute and Versions and support. Report security problems privately: security policy.

Licence

Apache-2.0. See LICENSE.md in the package for what the licence does not cover.