Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/comfortablycoding/directus-operation-slugify
A Directus slugify operation for Flows
https://github.com/comfortablycoding/directus-operation-slugify
directus directus-extension directus-extension-operation slug slugify
Last synced: about 23 hours ago
JSON representation
A Directus slugify operation for Flows
- Host: GitHub
- URL: https://github.com/comfortablycoding/directus-operation-slugify
- Owner: ComfortablyCoding
- License: mit
- Created: 2024-03-12T03:52:50.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-07-12T14:30:31.000Z (4 months ago)
- Last Synced: 2024-10-31T17:58:28.586Z (15 days ago)
- Topics: directus, directus-extension, directus-extension-operation, slug, slugify
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/directus-operation-slugify
- Size: 126 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# directus-operation-slugify
A [Directus](https://directus.io/) slugify [operation](https://docs.directus.io/app/flows/operations.html) for [Flows](https://docs.directus.io/app/flows.html#flows). It automatically handles most major languages, including German (umlauts), Vietnamese, Arabic, Russian, and more.
## Install
###### NPM
```shell
npm install directus-operation-slugify
```###### YARN
```shell
yarn add directus-operation-slugify
```###### PNPM
```shell
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.
```json
{ "slug": "[slug]" }
```## Bugs
If any bugs are found please report them as a [Github Issue](https://github.com/ComfortablyCoding/directus-operation-slugify/issues)
## License
[MIT](https://github.com/ComfortablyCoding/directus-operation-slugify/blob/main/LICENSE)