slug
functiondefault export@lpm.dev/neo.slug
function slug(input: string, options?: SlugOptions): string
Convert a string to a URL-safe slug
Parameters
input
stringString to slugifyoptionsoptional
SlugOptionsSlugification optionsReturns
stringURL-safe slugExample
slug('Hello World') // 'hello-world'
slug('Café München') // 'cafe-munchen'
slug('I ♥ JavaScript', { separator: '_' }) // 'i_love_javascript'
slug('Hello World', { lowercase: false }) // 'Hello-World'