vidandev / slug-gen

Zero dependency slug generator for the browser and Node.js with unicode support.

Home Page:https://github.com/vidandev/slug-gen

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Slug Generator

Zero dependency slug generator for the browser and Node.js with unicode support.

Build Status npm npm bundle size NPM

The library is written in TypeScript and provides typings, no need to install them separately.

Usage

import { slug } from "slug-gen";

console.log(slug("ĀāĂ ă Ą ą Ć ć Ĉ ĉ ĊċČčĎ"));
// -> aaa-a-a-a-c-c-c-c-ccccd

Current unicode support

Block range Block name
U+0000..U+007F Basic Latin
U+0080..U+00FF Latin-1 Supplement
U+0100..U+017F Latin Extended-A
U+0180..U+024F Latin Extended-B
U+0370..U+03FF Greek and Coptic
U+0400..U+04FF Cyrillic
U+0500..U+052F Cyrillic Supplement

About

Zero dependency slug generator for the browser and Node.js with unicode support.

https://github.com/vidandev/slug-gen

License:MIT License


Languages

Language:TypeScript 95.4%Language:JavaScript 4.6%