Saltar al contenido principal

Function: useSlugify()

useSlugify(text): string

Defined in: src/core/services/generator.service.ts:143

Converts a text string into a URL-friendly slug.

Parameters

text

string

The text to slugify. Must not be empty.

Returns

string

A lower-case, hyphen-separated slug with diacritics removed.

Throws

If text is empty or falsy.

Example

import { useSlugify } from "katanakit-js";

useSlugify("Hello World!"); // "hello-world"
useSlugify(" Café au Lait "); // "cafe-au-lait"