slugify-now
v1.0.1
Published
Simple, fast slugify utility for clean URL-safe strings.
Downloads
5
Maintainers
Readme
slugify-now
A minimal, fast, and zero-dependency slugify function to convert strings into URL-safe slugs.
Install
npm install slugify-nowUsage
import slugify from 'slugify-now';
const title = "Hello World! I'm Inkersal";
const slug = slugify(title);
console.log(slug); // "hello-world-im-inkersal"Typescript Usage
slugify(text: string): stringFeatures
- Converts to lowercase
- Removes accents and special characters
- Replaces non-alphanumerics with
- - Trims extra dashes
Examples
| Input | Output |
|--------------------------------|------------------------------|
| React & Node.js Crash Course | react-node-js-crash-course |
| Éléphant Café | elephant-cafe |
| spaced out | spaced-out |
