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

@stnd/utils

v0.5.0

Published

--- title: "@stnd/utils" aliases: [] created: 2026-07-05 07:47 modified: 2026-07-07 10:42 last_audited: 2026-07-14 audit_interval_days: 90 next_audit: 2026-10-12 audit_priority: 3 maturity: tree mode: read publish: false status: active tags: - package

Readme


title: "@stnd/utils" aliases: [] created: 2026-07-05 07:47 modified: 2026-07-07 10:42 last_audited: 2026-07-14 audit_interval_days: 90 next_audit: 2026-10-12 audit_priority: 3 maturity: tree mode: read publish: false status: active tags:

  • package
  • stnd theme: kernel type: package visibility: private

@stnd/utils

Pure utility functions for the Standard Ecosystem.


ELI5

The odds-and-ends drawer: slugify a title, count reading time, merge two config objects deeply, validate a filename. No framework, no side effects, zero dependencies — safe to import anywhere (Node, browser, Cloudflare Worker) without dragging anything else in.

import { slugify, formatDate } from "@stnd/utils";
slugify("Hello World!"); // "hello-world"
formatDate(new Date(), "dot"); // "24.03.14" — YY.MM.DD, two-digit year

Overview

@stnd/utils provides a collection of small, focused utility functions with zero dependencies. These functions are designed to be “pure” — they have no side effects and do not depend on any specific framework or environment (isomorphic).

Key Modules

String & Content (/utils.js)

  • slugify(text): Robust generation of URL-friendly slugs.
  • excerptWords(content, maxWords): Generates excerpts from Markdown.
  • firstParagraph(content): Extracts the first paragraph of text.
  • getReadingTime(text): Estimates reading time in minutes.
  • numberOfWords(text): Accurate word count for various languages.

Filenames & IDs (/filename.js)

  • isNanoId(str): Validates Nano ID format.
  • generateShortId(length): Generates a cryptographically secure short ID.
  • sanitizeFilename(name, fallback): Ensures a string is safe for use as a filename.
  • makeUniqueFilename(base, usedSet): Appends suffixes to avoid filename collisions.

CSS Sanitization (/css.js)

  • sanitizeCssColor(value): Validates and cleans CSS color strings.
  • sanitizeCssFontFamily(value): Validates font family declarations.
  • sanitizeCssNumber(value): Validates numeric values with units (px, rem, etc.).

Date & Time (/utils.js)

  • formatDate(date, format): Flexible date formatting (ISO, HTML, locale).
  • getYear(date): Extracts the year from various date formats.
  • timeAgo(timestamp): Human-readable relative time (e.g., “5m ago”).

Data & Logic (/utils.js)

  • deepMerge(target, …sources): Deeply merges multiple objects.
  • validateEmail(email): Basic email format validation.
  • filterData(arr, path, value): Filters an array of objects based on a nested property path.

Usage

import { slugify, formatDate } from "@stnd/utils";

const title = "Hello World!";
const slug = slugify(title); // "hello-world"

const today = formatDate(new Date(), "dot"); // "24.03.14" (YY.MM.DD)

Features

  • Tree-Shakable: Import only what you need to keep your bundles small.
  • Isomorphic: Works in Node.js, Browsers, and Edge Workers.
  • Zero Dependencies: Maximum portability and security.

Notes / Observations

  • The "dot" format is YY.MM.DD (two-digit year) — a prior version of this doc claimed "2024.03.14" (four-digit year), which doesn’t match formatDate‘s actual implementation in utils.js.

Todo

  • [ ] Nothing tracked yet. [priority:: 3] [token_scale:: 3] [created:: 2026-07-14] [area:: framework]