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

@padmaj/slugify

v1.0.2

Published

Convert strings to URL-friendly slugs. Handles unicode, configurable separator. Zero dependencies.

Readme

@padmaj/slugify

Convert strings to URL-friendly slugs. Handles unicode, configurable separator, optional max length. Zero dependencies. Works in Node and browser.

Install

npm install @padmaj/slugify

Usage

import { slugify } from '@padmaj/slugify'

slugify('Hello World!')          // → 'hello-world'
slugify('Héllo Wörld')          // → 'hello-world'
slugify('café au lait')         // → 'cafe-au-lait'
slugify('Version 2.0 Release')  // → 'version-2-0-release'
slugify('  multiple   spaces ') // → 'multiple-spaces'

Custom separator

slugify('Hello World', '_')              // → 'hello_world'
slugify('Hello World', { separator: '.' }) // → 'hello.world'

Preserve case

slugify('Hello World', { lowercase: false }) // → 'Hello-World'

Limit length

slugify('hello world foo bar', { maxLength: 11 }) // → 'hello-world'

Truncation never leaves a trailing separator.

API

slugify(input, separatorOrOptions?)

| Option | Type | Default | Description | |---|---|---|---| | separator | string | '-' | Character(s) used between words | | lowercase | boolean | true | Convert to lowercase | | maxLength | number | — | Truncate slug to this length |

Returns a string. Returns '' for empty or all-special-character input.

Notes

  • Unicode accents are stripped via NFD normalization (é → e, ö → o).
  • Consecutive non-alphanumeric characters are collapsed into a single separator.
  • Leading and trailing separators are removed.
  • The separator is safely escaped before use in regex — passing +, .*, or other regex chars is safe.
  • For untrusted input, always set maxLength to avoid generating unexpectedly long slugs.

License

MIT