Skip to content
On this page

Slugify

Slugifying is the action of converting a string into a valid URL (a slug).

This functions is ready to use without importing.

Overview

typescript
declare global {
  interface String {
    slugify(): string;
  }
}

Usage

typescript
const myTitle = 'This is my briliant title';

console.log(myTitle.slugify());

// output: this-is-my-briliant-title

Clinux UI - Released under the MIT License.