Aerostack
edit

text-slug-generate Edge Function — Content

Content

Generates a URL-safe slug from any string. Handles Unicode, accents, and special characters. Zero dependencies.

navin @navin verified
Updated Mar 12, 2026
GitHub

Edge function text-slug-generate Generates a URL-safe slug from any string. Handles Unicode, accents, and special characters. Zero dependencies.. Deployed on Cloudflare Workers — zero cold starts, globally distributed. Mount it via your Aerostack workspace to call it from any AI agent.

terminal — aerostack cli
$ npx aerostack add navin/text-slug-generate
smart_toy

Use with AI Assistants

MCP

Connect Claude, Cursor, or any MCP-compatible client — then call this function by slug

① Add MCP Server

Add this once — access all Aerostack functions from your AI tool.

claude_desktop_config.json
{
  "mcpServers": {
    "aerostack": {
      "url": "https://mcp.aerostack.dev",
      "type": "http"
    }
  }
}

② Call this function

Ask your AI to use the call_function tool with this slug:

call_function
call_function({
  slug: "text-slug-generate",
  args: {
    "input": "example_input",
    "separator": "-",
    "lowercase": true,
    "maxLength": 42
  }
})

text-slug-generate

Generates a URL-safe slug from any string. Handles Unicode, accents, and special characters. Zero external dependencies.

Install

aerostack function add text-slug-generate

Usage

import { generateSlug, isValidSlug } from './functions/text-slug-generate';

generateSlug('Hello World');              // 'hello-world'
generateSlug('Héllo Wörld');             // 'hello-world'
generateSlug('Top 10 AI Tools!');        // 'top-10-ai-tools'
generateSlug('My Post', { separator: '_' }); // 'my_post'
generateSlug('Long Title...', { maxLength: 20 }); // truncated slug

isValidSlug('hello-world');  // true
isValidSlug('Hello-World');  // false (uppercase)

API

POST /api/text-slug-generate
{ "input": "Hello World", "separator": "-", "lowercase": true, "maxLength": 50 }
{ "success": true, "data": { "slug": "hello-world", "valid": true } }
Field Type Required Default
input string
separator string (1 char) "-"
lowercase boolean true
maxLength number unlimited

Metadata

upgrade Version 1.0.0
gavel License MIT
language Language typescript
cloud Provider aerostack

Tags

text
deployed_code

Build and publish your own functions

Write a TypeScript function, deploy it to the edge, and share it with thousands of developers — in minutes.

More Content Functions

Browse Content Functions →

Frequently asked questions

What does the text-slug-generate function do? +

text-slug-generate is a serverless edge function for content automation written in aerostack. Deploy it to Cloudflare Workers via your Aerostack workspace.

How do I deploy the text-slug-generate function? +

Install the Aerostack CLI and run: ```bash aerostack deploy function @navin/text-slug-generate ``` It will be live on Cloudflare Workers in seconds.

What runtime does text-slug-generate use? +

text-slug-generate runs on aerostack on the Cloudflare Workers edge runtime — zero cold starts, globally distributed.

Can I customise the text-slug-generate function? +

Yes. Fork the function from your Aerostack dashboard, modify the source, and redeploy. All changes are version-controlled.