slugify

Converts any string into a clean, URL-safe slug with built-in Unicode transliteration for dozens of languages.

Library
npm
v1.6.9
1,742stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
47/100Fair
Development Activity28
Maintenance4
Community56
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
61/100Good
Architecture68
Code Quality72
Innovation78
Learning Curve25

Slugify is a zero-dependency JavaScript library that turns any string into a clean, URL-friendly slug. It ships with an extensive character map covering Latin, Greek, Cyrillic, Arabic, Armenian, Georgian, Persian, Thai script, and currency symbols, so accented and non-Latin text is transliterated to its closest ASCII equivalent instead of being stripped outright.

Beyond the default character map, slugify supports per-locale overrides for languages such as German, Bulgarian, Danish, Ukrainian, and Vietnamese where the general transliteration doesn’t match local convention, a runtime extend() API for adding or overriding characters, and configurable options for the replacement character, character removal, casing, and trimming. It ships as a single dependency-free module with TypeScript typings and works equally in Node.js, the browser, and AMD/CommonJS module loaders.

What You Get

  • A single slugify(string, options) function with no runtime dependencies
  • An extensive built-in charMap covering Latin, Greek, Cyrillic, Arabic, Armenian, Georgian, Persian, Thai script, and currency symbols
  • Locale-specific overrides for languages such as German, Bulgarian, Danish, Ukrainian, and Vietnamese where transliteration rules differ from the default map
  • A runtime extend() method to add or override character mappings without patching the library
  • Configurable options for replacement character, character-removal regex, case conversion, strict mode, and trimming
  • Bundled TypeScript type definitions (slugify.d.ts)

Common Use Cases

  • Generating SEO-friendly URL slugs from blog post or product titles
  • Creating safe filenames from user-uploaded file titles
  • Normalizing non-Latin usernames or tags into ASCII-safe identifiers
  • Building consistent anchor IDs from heading text for in-page navigation

Under The Hood

Architecture Slugify ships as a single-file UMD module (slugify.js) exporting one function via a factory pattern that supports CommonJS, AMD, and browser globals. The runtime logic reduces the input string character-by-character against two embedded lookup tables — charMap for the default transliteration set and locales for a small set of per-language overrides — then applies the removal regex, replacement-character substitution, and an optional trim/lowercase pass. There’s no internal layering or external dependencies, and the only build step (bin/build.js) regenerates the embedded charMap/locales JSON blobs in slugify.js from the source-of-truth files in config/, so changing the core transliteration logic only ever touches this one module.

Tech Stack The library is vanilla ES2015+ JavaScript with zero runtime dependencies. Its devDependencies are limited to mocha (test runner), nyc (coverage), coveralls (CI coverage reporting), and github-changes (changelog generation from merged PRs). It bundles hand-written TypeScript typings (slugify.d.ts), targets Node >=8 per engines, and requires no bundler, framework, or database — it is consumed directly via require, an AMD loader, or a browser global.

Code Quality Tests in test/slugify.js and test/locales.js use Mocha with Node’s built-in assert module, covering whitespace handling, allowed/removed characters, every major charMap group (Latin, Greek, Cyrillic, Turkish, Kazakh, Czech, Polish, Latvian, Serbian, currency symbols, and general symbols), the extend() API, the strict/trim/lower/replacement/remove options, and edge cases such as empty-string charmap entries and Unicode normalization. Coverage is measured with nyc and reported to Coveralls, and CI runs the suite via a GitHub Actions workflow. Error handling is limited to a single thrown Error for a missing string argument; there is no ESLint or Prettier configuration in the repo.

API Design The public API is a single function, slugify(string, options), with sensible defaults (dash replacement, trim enabled) and a shorthand where passing a string as the second argument is treated directly as the replacement character — keeping the common case to one call with no configuration object required. More advanced needs (custom charmaps, per-locale overrides, strict ASCII-only output) are opt-in via a plain options object, and the extend() static method offers a lightweight way to augment the charMap process-wide without forking the package. The README documents every option with runnable examples.

Used by 27 apps in this directory

TypeScript
99%
Other

Activepieces

Automation · AI Assistants

24,298

Open-source AI automation platform that converts 280+ workflow integrations into MCP servers for LLMs, with no-code builders and TypeScript extensibility.

View details
92
Repo Health
85
Technical
64
Dependency
Built with
TypeScript99%
Updated today
JavaScript
95%
MIT

AnythingLLM

Developer Tools · Automation · AI Assistants

65,696

The all-in-one AI platform for private document chat, no-code agents, and local LLMs with zero setup friction.

View details
90
Repo Health
78
Technical
64
Dependency
Built with
JavaScript95%
Updated 3 days ago
JavaScript
100%
Other

Automatisch

Automation · No Code Platforms

13,964

Self-hosted, no-code workflow automation that keeps your data on your own servers—a privacy-first alternative to Zapier with 90+ integrations.

View details
49
Repo Health
78
Technical
63
Dependency
Built with
JavaScript100%
Updated 6 months ago
Rust
67%
MIT

Bun

Developer Tools

95,895

An all-in-one JavaScript and TypeScript toolkit — one Rust-and-JavaScriptCore binary that replaces Node.js, npm, a bundler, and a test runner with faster equivalents.

View details
92
Repo Health
91
Technical
64
Dependency
Built with
Rust67%
C++19%
Updated yesterday
TypeScript
93%
AGPL 3.0

CourseLit

Ecommerce · Blogging

1,262

Open-source, self-hosted LMS for selling online courses, digital downloads, and building communities on your own branded website.

View details
75
Repo Health
74
Technical
71
Dependency
Built with
TypeScript93%
Updated 1 months ago
TypeScript
98%
Other

Dokploy

Devops · Hosting Control Panel · Security

37,130

Self-hosted PaaS that deploys apps and databases on your own VPS using Docker, Traefik, and multi-build-system orchestration

View details
88
Repo Health
76
Technical
64
Dependency
Built with
TypeScript98%
Updated 3 days ago
TypeScript
83%
Apache 2.0

Grist

Databases · No Code Platforms

11,726

A modern relational spreadsheet that combines Python-powered formulas, drag-and-drop dashboards, and granular access controls in a self-hostable, SQLite-backed data platform.

View details
91
Repo Health
93
Technical
66
Dependency
Built with
TypeScript83%
Python11%
Updated yesterday
TypeScript
95%
AGPL 3.0

HeyForm

Forms Surveys · No Code Platforms

8,965

Open-source conversational form builder with AI generation, conditional logic, and 30+ integrations — self-host with full data ownership.

View details
85
Repo Health
67
Technical
67
Dependency
Built with
TypeScript95%
Updated 1 weeks ago
TypeScript
61%
EPL-2.0

Huly Platform

Project Management · Team Chat · Collaboration

27,586

Open-source all-in-one workspace that replaces Linear, Jira, Slack, and Notion for product and engineering teams.

View details
89
Repo Health
86
Technical
62
Dependency
Built with
TypeScript61%
Svelte34%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search