The following options are available for getSlug(input, options) and createSlug(options):
| Option | Type | Default | Description |
|---|
separator | string | '-' | Character that replaces whitespaces |
lang | string/boolean | 'en' | ISO 639-1 code for language-specific transliteration |
symbols | boolean | true | Whether to convert symbols according to lang |
maintainCase | boolean | false | Whether to maintain character case |
titleCase | boolean/array | false | Convert to title-case; if array, omit those words |
truncate | number | 0 | Max length (trims without breaking words) |
uric | boolean | false | Allow ;, ?, :, @, &, =, +, $, ,, / |
uricNoSlash | boolean | false | Allow ;, ?, :, @, &, =, +, $, , |
mark | boolean | false | Allow -, _, ., !, ~, *, ', (, ) |
custom | object/array | {} | Object for custom translation map or array for allowed chars |
{
"separator": "-",
"lang": "en",
"symbols": true,
"maintainCase": false,
"titleCase": false,
"truncate": 0,
"uric": false,
"uricNoSlash": false,
"mark": false,
"custom": {}
}