slugy

Easily slugify url & titles from any ordinary string.

Usage no npm install needed!

<script type="module">
  import slugy from 'https://cdn.skypack.dev/slugy';
</script>

README

🌐 Slugy

Easily slugify url & titles from any ordinary string.

code style: prettier npm version Dependencies npm downloads package phobia bundle phobia

Installation

Using yarn:

yarn add slugy

Using npm:

npm i slugy

Usage

import { slugy } from 'slugy';

const slug = await slugy('Hello World'); // hello-world

// With options:
const slug = await slugy('Hello World', { separator: '_', lower: false }); // Hello_World

// Turning off Unidecode
const slug = slugy('\u1515\u14c7\u14c7', { unidecode: false }); // ᔕᓇᓇ