slugify-tr
v1.0.0
Published
URL-friendly slug generator for Turkish strings
Maintainers
Readme
🔤 slugify-tr
Convert Turkish strings into clean, URL-friendly slugs — perfect for SEO, blog URLs, article titles, and more.
Supports Turkish-specific characters like ç, ğ, ü, ş, ö, ı, İ and replaces them with their ASCII equivalents.
📦 Installation
Using npm
npm install slugify-trUsing yarn
yarn add slugify-tr🚀 Usage
const slugify = require("slugify-tr");
console.log(slugify("Çok Güzel Bir Yazı!"));
// → "cok-guzel-bir-yazi"
console.log(slugify("İstanbul'da Şehir Hayatı"));
// → "istanbulda-sehir-hayati"
console.log(slugify("Merhaba Dünya!"));
// → "merhaba-dunya"⚙️ Options
No options required.
The function automatically handles:
- Turkish character replacements
- Lowercasing
- Removing special characters
- Replacing whitespace with hyphens
📤 Output Examples
| Input | Output |
|------------------------------|---------------------------|
| Çok Güzel Bir Yazı! | cok-guzel-bir-yazi |
| İstanbul'da Şehir Hayatı | istanbulda-sehir-hayati|
| Merhaba Dünya! | merhaba-dunya |
🧪 Run Test
node test.js🪪 License
MIT