1.0.0 ⢠Published 5 months ago
slugify-plus v1.0.0
š 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-world
2ļøā£ Custom Separator
console.log(slugify("Hello World!", { separator: "_" }));
// Output: hello_world
3ļøā£ Stop Word Removal
console.log(slugify("The Quick Brown Fox", { removeStopWords: true }));
// Output: quick-brown-fox
4ļøā£ Limit Slug Length
console.log(slugify("This is a very long title", { maxLength: 10 }));
// Output: this-is-a
5ļøā£ 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.
1.0.0
5 months ago