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

@simpill/uuid.utils

v1.0.0

Published

Generate and validate UUIDs (v1/v4/v5) with full TypeScript support (Node and Edge).

Readme

Features: Type-safe · Node & Edge · Lightweight


When to use: You need to generate, validate, or compare UUIDs (v1/v4/v5) with a small, type-safe API. Use generateUUID() or generateUUIDv4() for IDs; use isUUID / validateUUID for input validation (both return a boolean; neither throws). Use compareUUIDs for equality checks (returns boolean). All APIs work in Node and browser; use @simpill/uuid.utils/shared or the main entry — client/server entries re-export the same shared code.


Installation

From npm

npm install @simpill/uuid.utils

From GitHub

To use this package from the monorepo source:

git clone https://github.com/SkinnnyJay/simpill.git
cd simpill/utils/@simpill-uuid.utils
npm install && npm run build

In your project you can then install from the local path: npm install /path/to/simpill/utils/@simpill-uuid.utils or use npm link from the package directory.


Quick Start

import {
  generateUUID,
  generateUUIDv4,
  isUUID,
  validateUUID,
  compareUUIDs,
} from "@simpill/uuid.utils";

const id = generateUUID();
const v4 = generateUUIDv4();
if (isUUID(id)) { /* ... */ }
validateUUID(id); // true if valid, false otherwise (does not throw)
compareUUIDs(a, b); // true if equal, false otherwise
parseUUID(str);    // returns UUID string or null

Features

| Feature | Description | |---------|-------------| | generateUUID / generateUUIDv4 | Generate UUIDs (v4 default) | | generateUUIDv1 / generateUUIDv5 | Version-specific generation | | validateUUID | Returns true if valid, false otherwise (does not throw) | | isUUID | Type guard / boolean check (same as validateUUID) | | parseUUID | Returns UUID string if valid, otherwise null | | compareUUIDs | Returns true if equal, false otherwise (case-sensitive) | | UUIDHelper | Object with same methods |


Import Paths

import { ... } from "@simpill/uuid.utils";         // Everything
import { ... } from "@simpill/uuid.utils/client"; // Client
import { ... } from "@simpill/uuid.utils/server"; // Server
import { ... } from "@simpill/uuid.utils/shared";  // Shared only

API Reference

  • generateUUID(), generateUUIDv1(), generateUUIDv4(), generateUUIDv5(namespace, name)
  • validateUUID(uuid) → boolean — true if valid RFC 4122 UUID
  • isUUID(uuid) → boolean — same as validateUUID
  • parseUUID(value) → string | null — returns the string if valid, null otherwise
  • compareUUIDs(a, b) → boolean — true if equal (case-sensitive)
  • UUIDHelper — namespace object with the same methods

Examples

npx ts-node examples/01-basic-usage.ts

validateUUID vs parseUUID: validateUUID(str) returns true/false and never throws. Use it for checks. parseUUID(str) returns the string if valid or null otherwise — use it when you need a single call that both validates and returns the value (or null).

v5 (namespace + name): Pass a namespace UUID and a name; the same name in the same namespace always yields the same UUID (e.g. for stable IDs from URLs):

import { generateUUIDv5 } from "@simpill/uuid.utils";
import { NAMESPACE_DNS } from "uuid";

const id = generateUUIDv5("example.com", NAMESPACE_DNS);

Case sensitivity: RFC 4122 permits lowercase and uppercase hex. This package compares UUIDs with strict string equality (compareUUIDs); normalize to lowercase (e.g. uuid.toLowerCase()) before comparing if you need case-insensitive equality.

What we don’t provide

  • UUID v3 / v7 — Only v1, v4, and v5 are supported. For v3 (MD5-based) or v7 (time-ordered), use the uuid package directly.
  • Stringify / parse bytes — No conversion between UUID strings and 16-byte buffers. Use the uuid package (bufferFromUUID / uuidToBuffer-style APIs) if you need binary serialization.
  • Version-specific guards — No isUUIDv4(str) or similar. Use validateUUID(str) and, if you need the version, parse the 13th character (e.g. str[14] for the version nibble) or use a library that exposes version helpers.

| Example | Description | |---------|-------------| | 01-basic-usage.ts | generateUUID, validateUUID, isUUID, parseUUID, compareUUIDs |


Development

npm install
npm test
npm run build
npm run verify

Documentation


License

ISC