📈 GH Trending Explorer 🎲 Surprise me

← all repos

productdevbook / cizgile

git clone https://github.com/productdevbook/cizgile.git v1.0.0 · 2d ago

cizgile — Zero-dependency URL slug engine. RFC 3986/3987 slugs, transliteration for 7 scripts, Unicode slugs, IRI ↔ URI, percent-encoding. Pure TypeScript, works everywhere.

+1
stars, 24h · #15,382
+~54
stars, 7 days · #3,728
+~230
stars, 30 days · #3,438
122
★ total · +54% this week
1
forks · 0 open issues

Star history (as recorded here)

2026-10-20 · 99 ★ 2026-10-23 · 122 ★
LanguageTypeScript
License—
Created2026-08-31 (1mo ago)
Last push2d ago
Watchers1
OwnerUser

GitHub topics

Links

README excerpt
cizgile 
 Zero-dependency URL slug engine.
 Turn any title into a clean URL slug — in any language — and work with URLs the way RFC 3986 and RFC 3987 describe them. Pure TypeScript, works everywhere.
## Quick start
 [code] 
 [code] 
ESM only, no dependencies. Tested on Node 20+ and Bun; it uses no host APIs, so it also runs in browsers and edge workers.
## Contents
- Why cizgile
- Entry points
- Slugs
- Languages and scripts
- URL toolkit
- Full IDNA
- For AI agents
- Performance
- How it compares
- Development
## Why cizgile
- **Correct by construction.** Every ASCII slug is a valid URL path segment (RFC 3986 `segment-nz-nc`): no percent-encoding needed, never `.` or `..`, never mistaken for a scheme.
- **Speaks your language.** 50 locales and 24 scripts: `ß` → `ss`, `İ` → `i`, `Щ` → `shch`, `서울` → `seoul`, `กรุงเทพ` → `krungthep`.
- **Unicode slugs when you want them.** `你好-world` stays readable, and `iriToUri` gives you the exact percent-encoded form for the wire.
- **A real URL toolkit.** Resolve, normalise, compare, validate and relativise URLs by the RFC, cross-checked against the WHATWG `URL` parser.
- **Small and tree-shakeable.** `import { slugify }` ships only the Latin table. Other scripts are added to your bundle only when you import them.
## Entry points
| Import | What you get |
| ----------------------- | ----------------------------------------------------------------------------------------------------- |
| `cizgile` | `slugify`, `isSlug`, `createSlugger`, `truncateSlug`, `measure`, `decamelize`, script and bidi guards |
| `cizgile/transliterate` | `transliterate`, per-script tables, locales, `defineLocale`, `registerLocale` |
| `cizgile/uri` | Percent-encoding, `resolveUri`, `normalizeUri`, `relativize`, validators, IRI ↔ URI, punycode |
| `cizgile/uri/idna` | Full UTS #46 `idnaToAscii` / `idnaToUnicode` (optional, ~45 KB) |
## Slugs
### Everyday use
 [code] 
### Unique slugs
 [code] 
### Validation
 [code] 
`isSlug` accepts exactly what `slugify` would produce with the same options, including `locale`.
### Unicode slugs
 [code] 
Unicode slugs keep letters, digits and combining marks. They are NFKC-normalised, never start with a mark, and never contain invisible or bidi-control characters.
For user-supplied titles there are two optional guards:
 [code] 
- `scripts` applies a UTS #39 restriction level: `"single"`, `"highly-restrictive"`, `"moderately-restrictive"` or `"any"`.
- `bidi` enforces the RFC 3987 §4.2 direction rule: `"allow"`, `"encode"` or `"throw"`.
### Options
| Option | Default | What it does |
| --------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `separator` | `"-"` | Joins words. Any URL-safe punctuation (`- _ . ~ !$&'()*+,;= @`), several characters (`"--"`), or `""`. |
| `lowercase` | `true` | `false` keeps the original case. |
| `unicode` | `false` | Keep letters from every script