Skip to content

ComfortablyCoding/directus-operation-slugify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

directus-operation-slugify

A Directus slugify operation for Flows. It automatically handles most major languages, including German (umlauts), Vietnamese, Arabic, Russian, and more.

Install

NPM
npm install directus-operation-slugify
YARN
yarn add directus-operation-slugify
PNPM
pnpm add directus-operation-slugify

Options

Separator

The separator to use between words. Defaults to -.

Lowercase

Convert all string lowercase. Defaults to true.

Decamelize

Convert camelcase to separate words (e.g. loremIpsum -> lorem ipsum). Defaults to true

Custom Replacements

Replace specific characters or words with alternatives (.e.g & -> and). Adding a leading and trailing space to the replacement will have it separated by dashes. Defaults to '&' -> ' and '.

Output

An object containing the slugified input.

{ "slug": "[slug]" }

Bugs

If any bugs are found please report them as a Github Issue

License

MIT