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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@gluwa/frontend-util

v1.3.0

Published

utils for gluwa frontend

Readme

@gluwa/frontend-util

@gluwa/frontend-util is JavaScript utility library for Gluwa frontend projects

Publishing Process

Version Control Flow

  1. Feature Branch

    • Update version in package.json (e.g., 1.0.1)
    • Follow SemVer guidelines:
      • MAJOR: incompatible API changes
      • MINOR: backward compatible features
      • PATCH: backward compatible fixes
  2. Dev Branch

    • Merge Feature → Dev
    • Automatic RC version publish
    • Example: 1.0.1-rc.1, 1.0.1-rc.2, etc.
  3. Main Branch

    • Merge Dev → Main
    • Automatic stable version publish
    • Example: 1.0.1

Installing Packages

# Latest Stable Version
npm install @gluwa/frontend-util
yarn add @gluwa/frontend-util
pnpm add @gluwa/frontend-util
bun add @gluwa/frontend-util

# Release Candidate Version
npm install @gluwa/frontend-util@rc
yarn add @gluwa/frontend-util@rc
pnpm add @gluwa/frontend-util@rc
bun add @gluwa/frontend-util@rc

Checking Versions

# Check RC Version
npm view @gluwa/frontend-util@rc version

Usage Examples

React Functional Component

import { getYear } from "@gluwa/frontend-util";
import { useEffect, useState } from "react";

export default function Footer() {
  const [year, setYear] = useState<number | null>(null);

  useEffect(() => {
    async function fetchYear() {
      try {
        const fetchedYear = await getYear();
        setYear(fetchedYear);
      } catch (err) {
        setYear(null);
        console.error(err);
      }
    }

    fetchYear();
  }, []);

  return (
    <footer>
      <p>© Copyright {year ?? ""} Gluwa™</p>
    </footer>
  );
}

React Class Component

import { getYear } from "@gluwa/frontend-util";
import React, { Component } from "react";

class Footer extends Component {
  state = {
    year: null,
  };

  async componentDidMount() {
    try {
      const fetchedYear = await getYear();
      this.setState({ year: fetchedYear });
    } catch (err) {
      this.setState({ year: null });
      console.error(err);
    }
  }

  render() {
    const { year } = this.state;
    return (
      <footer>
        <p>© Copyright {year ?? ""} Gluwa™</p>
      </footer>
    );
  }
}

export default Footer;

Development & Testing Guide

How to test in a local project

  1. Finish code updates
  • Follow SemVer guidelines:
    • MAJOR: incompatible API changes
    • MINOR: backward compatible features
    • PATCH: backward compatible fixes
  1. Build
npm run build
  1. Create a tarball
npm pack

A file like gluwa-frontend-util-1.2.3.tgz will be generated in the project root.

  1. Install in a consuming project
npm i {...}/frontend-util/gluwa-frontend-util-1.2.3.tgz

Test Coverage

You can run the coverage locally and check the report.

npm run coverage
  • Creation location: coverage/

    • coverage/lcov-report/index.html (HTML report)
    • coverage/lcov.info (LCOV format)
    • coverage/coverage-final.json (JSON)
    • coverage/clover.xml (Clover)
  • Open HTML report on macOS:

open coverage/lcov-report/index.html
  • Thresholds and collection rules are defined in jest.config.cjs (for src/** files, functions ≥ 90%):
// jest.config.cjs (excerpt)
coverageDirectory: 'coverage',
coverageThreshold: {
  "./src/**": {
    functions: 90,
  }
}

How to check version history

npm view @gluwa/frontend-util versions
  • Output
[
  '1.0.0',      '1.0.1',       '1.0.2',
  '1.0.3',      '1.0.4',       '1.0.5',
  '1.0.6',      '1.0.7',       '1.0.8',
  '1.0.9',      '1.0.10-rc.1', '1.0.10-rc.2',
  '1.1.0-rc.3', '1.2.0-rc.1',  '1.2.0-rc.2',
  '1.2.0-rc.3', '1.2.0-rc.4',  '1.2.0',
  '1.2.1-rc.1', '1.2.1-rc.2',  '1.2.1',
  '1.2.2-rc.1', '1.2.2-rc.2',  '1.2.2',
  '1.2.3-rc.1', '1.2.3-rc.2',  '1.2.3-rc.3',
  '1.2.3-rc.4', '1.2.3-rc.5',  '1.2.3-rc.6',
  '1.2.3'
]