ember-slugify

Library to slugify your strings within Ember.
This library uses:
Compatibility
- Ember.js v4.8 or above
- Embroider or ember-auto-import v2
Installation
ember install ember-slugify
Usage
In a js file
import slugify, { removeDiacritics } from 'ember-slugify'
let slug = slugify('Le Théâtre')
slug = slugify('I ♥ New York')
slug = slugify("Vive l'♥", { locale: 'fr' })
slug = slugify('bonjour monsieur', { replacement: '#' })
slug = slugify('你好你怎么样 monsieur', { pinyin: true })
slug = slugify('🇫🇷❤️🥖➕🍷', { emoji: true })
let noDiacritics = removeDiacritics('Le Théâtre')
In a template
{{slugify 'Le Théâtre'}}
{{slugify '你好你怎么样 monsieur' (hash pinyin=true)}}
{{slugify '🇫🇷❤️🥖➕🍷' (hash emoji=true)}}
{{remove-diacritics 'Le Théâtre'}}
The separator option is not available on slugify helper.
Options
| replacement | replace spaces with replacement character | '-' |
| lower | convert to lower case | true |
| locale | language code of the locale to use | undefined |
| trim | trim leading and trailing replacement chars | true |
| pinyin | replace chinese by latin character following the pinyin method | false |
| emoji | replace unicode emoji by it's description | false |
Contributing
See the Contributing guide for details.
Contributors
License
This project is licensed under the MIT License.