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

@codeberry/slugger

v1.0.3

Published

A simple and flexible Strapi plugin for automatically generating unique slugs based on configurable fields

Readme

Slugger - Strapi Plugin

🚀 Slugger is a Strapi plugin that automatically generates SEO-friendly slugs for your content entries based on specified fields.

✅ Compatible with Strapi v5.10.2 and above


✨ Features

  • Automatic slug generation on beforeCreate and beforeUpdate events
  • Per collection type configuration to specify source and slug fields
  • Ensures unique slugs within a collection to avoid duplicates
  • Custom slug field for each collection type

📦 Installation

Via npm:

npm install @codeberry/slugger

Via yarn:

yarn add @codeberry/slugger

⚙️ Configuration

To configure Slugger, modify your config/plugins.ts file:

export default {
  slugger: {
    enabled: true,
    config: {
      slugConfig: {
        article: { sourceField: "title", slugField: "slug" },
      },
    },
  },
};

Configuration Breakdown:

  • article → The collection type where slug generation should be applied
  • sourceField: "title" → Field from which the slug is generated
  • slugField: "slug" → Field where the generated slug is stored

🔧 Adding the Slug Field to Your Collection

This plugin does not automatically add the slug field. You need to manually add it using the Strapi Admin Panel:

Steps to Add the Slug Field:

  1. Go to Strapi Admin Panel → Content-Type Builder
  2. Open the collection type where you want to generate slugs (e.g., article)
  3. Click "Add another field"
  4. Navigate to the Custom Fields tab
  5. Select the field named "Slug"
  6. Enter a name for the field (e.g., slugHere or slug)
    • This name must match the slugField value in your plugin configuration
  7. Save and apply the changes

Now, the plugin will store the generated slugs in this field automatically.


🛠 Usage

Once configured, the plugin will automatically generate slugs before an entry is created or updated.

  • If an entry in article has a title, it will generate a slug from it.
  • If a slug already exists, a unique version will be created (e.g., my-title, my-title-1).

📌 Example Behavior

| Title | Generated Slug | |----------------------------|------------------------| | "Hello World" | hello-world | | "Hello World" (duplicate) | hello-world-1 | | "Strapi is Awesome!" | strapi-is-awesome |


🔍 Ensuring Slug Uniqueness

Slugs are made unique within the collection type by appending an incremental counter if necessary.


📝 Notes

  • This plugin does not modify existing slugs unless the sourceField is updated.
  • Ensure the slug field is added using the Custom Fields tab in Strapi Admin.
  • The slug field name must match what is set in slugField inside the plugin configuration.

🤝 Contributing

Want to contribute? Feel free to fork the repository, open issues, or submit PRs! 🚀


📄 License

This project is licensed under the MIT License.


🎉 Now you're all set! Happy slugging! 🚀