slugify-plus
v1.0.0
Published
A customizable and scalable slug generator for Node.js with TypeScript support
Maintainers
Readme
🏆 Slugify-Plus - The Ultimate Slug Generator for Node.js 🚀
Slugify-Plus is an advanced, customizable, and developer-friendly slug generator for Node.js and JavaScript applications.
It helps create SEO-friendly URLs, unique identifiers, database keys, and human-readable slugs for various use cases.
🔥 Key Features
- 🌍 Supports multiple languages (transliteration for non-Latin characters).
- 🔠 Converts text into URL-safe slugs.
- 🎨 Customizable separators (
-,_,|,.). - 🚀 Removes common stop words for better readability.
- 🔢 Supports max-length truncation to fit database constraints.
- 🔄 Auto-appends unique IDs if a duplicate exists.
- 🔑 CLI Support for command-line usage.
🎯 Why Use Slugify-Plus Over Other Slug Generators?
| Feature | Slugify-Plus ✅ | Other Libraries ❌ | |------------------------|----------------|--------------------| | Multi-language Support | ✅ Yes | ❌ Limited | | Custom Separators | ✅ Yes | ❌ No | | Stop Word Removal | ✅ Yes | ❌ No | | Database Friendly | ✅ Yes | ❌ No | | Unique ID Handling | ✅ Yes | ❌ No | | CLI Support | ✅ Yes | ❌ No | | TypeScript Support | ✅ Yes | ❌ No |
📦 Installation
Install the package via npm or yarn:
# Using npm
npm install slugify-plus
# Using yarn
yarn add slugify-plus🚀 Usage Guide
1️⃣ Basic Slug Generation
const { slugify } = require("slugify-plus");
console.log(slugify("Hello World!"));
// Output: hello-world2️⃣ Custom Separator
console.log(slugify("Hello World!", { separator: "_" }));
// Output: hello_world3️⃣ Stop Word Removal
console.log(slugify("The Quick Brown Fox", { removeStopWords: true }));
// Output: quick-brown-fox4️⃣ Limit Slug Length
console.log(slugify("This is a very long title", { maxLength: 10 }));
// Output: this-is-a5️⃣ CLI Support
npx slugify-plus "Hello World!"
# Output: hello-world🌍 Open Source Contribution
Slugify-Plus is open source and welcomes contributions from developers worldwide. 💜
🛠 How to Contribute?
- Fork the Repository on GitHub.
- Clone the Repository
git clone https://github.com/imankii01/slugify-plus.git cd slugify-plus - Install Dependencies
npm install - Create a New Branch
git checkout -b feature-new-slug-format - Make Your Changes & Commit
git commit -m "Added new slug format feature" - Push Changes & Create a Pull Request
git push origin feature-new-slug-format - Submit a PR on GitHub 🚀
💡 Use Cases
- 📌 SEO Optimization - Generate SEO-friendly URLs automatically.
- 🔑 Database & File Naming - Avoid spaces in filenames & database keys.
- 🌐 CMS & Blogging Platforms - Convert titles into clean slugs.
- 📂 Short URLs & Usernames - Generate readable & shareable links.
🎉 Support the Project
If you find this package useful, consider supporting me:
☕ Buy Me a Coffee
⭐ Star this project on GitHub
📄 License
This project is licensed under the MIT License.
