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

@khalidsaidi/slugshade

v0.1.0

Published

SlugShade - cyber-native, Unicode-first slug engine (AI-native trace + optional AI hook).

Downloads

10

Readme

SlugShade

Neon-grade slugs for every script. Cyber-native, Unicode-first, and built to be AI-friendly.

Why SlugShade

  • Unicode-first by default: keeps non-Latin scripts (Arabic, Cyrillic, Greek, Han, etc.) instead of stripping them away.
  • ASCII mode that never returns empty: unknown scripts become stable u<hex> tokens.
  • AI-native debugging: slugDetailed() returns a step-by-step trace of transformations.
  • Optional AI hook: slugAsync() accepts your AI function, then SlugShade re-sanitizes deterministically.
  • Zero runtime dependencies.

Install

npm i @khalidsaidi/slugshade

Quick Start

import { slug, slugDetailed, slugAsync, presets } from '@khalidsaidi/slugshade';

slug('Hello, world!');
// => hello-world

slug('مرحبا بالعالم');
// => مرحبا-بالعالم

slug('你好 世界', { alphabet: 'ascii' });
// => u4f60-u597d-u4e16-u754c

slug('C++ & C#', { ...presets.safe });
// => cpp-and-csharp

const traced = slugDetailed('Hello 🚀', { alphabet: 'ascii', emoji: 'name' });
// traced.steps => normalization / symbols / emoji / segmentation / strict / ...

const aiSlug = await slugAsync('How to ship fast', {
  ...presets.cyber,
  ai: async ({ deterministic }) => `🔥 ${deterministic}`,
});
// => fire-how-ship-fast

API

slug(input, options?)

Returns a deterministic slug string.

slugDetailed(input, options?)

Returns:

  • slug
  • tokens
  • warnings
  • steps transformation trace

slugAsync(input, { ...options, ai })

Runs your AI suggester and then re-sanitizes output with the same deterministic rules.

createSlugger(defaults)

Returns a reusable function with preconfigured defaults.

uniqueSlug(base, isTaken, opts?)

Finds an available suffix (-1, -2, ...).

Options

type SlugOptions = {
  separator?: '-' | '_' | '.';
  lowercase?: boolean;
  locale?: string;
  maxLength?: number;
  alphabet?: 'unicode' | 'ascii';
  mode?: 'classic' | 'semantic';
  strict?: boolean;
  emoji?: 'remove' | 'keep' | 'name';
  symbols?: 'basic' | 'extended' | false;
  tech?: boolean;
  stopwords?: 'auto' | string[] | false;
  keepNumbers?: boolean;
  reserved?: string[];
  unknown?: 'drop' | 'hex';
  fallback?: string | ((input: string, ctx: { tokens: string[] }) => string);
};

Presets

  • presets.safe: strict ASCII output with symbol and tech rewrites.
  • presets.cyber: semantic + emoji naming + ASCII output.
  • presets.unicode: semantic + emoji naming, Unicode output.

Safety Guarantees

  • Never returns . or ..
  • Never returns slashes
  • Handles reserved names (admin, api, con, nul, etc.)
  • Fallback always produces a stable slug with hash suffix

Development

npm run lint
npm run typecheck
npm test
npm run build
npm run publint
npm run chaos:user

chaos:user runs an isolated first-time-user simulation in /tmp:

  • packs the library
  • installs it in a fresh project
  • executes ESM + CJS smoke checks
  • runs randomized fuzz checks for unsafe output invariants

Useful env vars:

CHAOS_FUZZ_CASES=3000 npm run chaos:user
CHAOS_KEEP_TMP=1 npm run chaos:user

Publish Checklist

npm run prepublishOnly
npm pack --dry-run

Optional CI Chaos Run

Use the Chaos workflow in GitHub Actions (workflow_dispatch) to run the same isolated first-user chaos suite in CI.

License

MIT