Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-slugify

Package Overview
Dependencies
Maintainers
5
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-slugify

Library to slugify your strings within Ember.

  • 6.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24
decreased by-78.76%
Maintainers
5
Weekly downloads
 
Created
Source

ember-slugify

CI Ember Observer Score License: MIT

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')
// le-theatre

slug = slugify('I ♥ New York')
// i-love-new-york

slug = slugify("Vive l'♥", { locale: 'fr' })
// vive-lamour

slug = slugify('bonjour monsieur', { replacement: '#' })
// bonjour#monsieur

slug = slugify('你好你怎么样 monsieur', { pinyin: true })
// ni-hao-ni-zen-me-yang-monsieur

slug = slugify('🇫🇷❤️🥖➕🍷', { emoji: true })
// flag-france-red-heart-baguette-bread-plus-wine-glass

let noDiacritics = removeDiacritics('Le Théâtre')
// Le Theatre

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

namedescriptiondefault value
replacementreplace spaces with replacement character'-'
lowerconvert to lower casetrue
localelanguage code of the locale to useundefined
trimtrim leading and trailing replacement charstrue
pinyinreplace chinese by latin character following the pinyin methodfalse
emojireplace unicode emoji by it's descriptionfalse

Contributing

See the Contributing guide for details.

Contributors

MrChocolatine
MrChocolatine
GreatWizard
GreatWizard
saintsebastian
saintsebastian
BlueCutOfficial
BlueCutOfficial
mathieupoteriepeopledoc
mathieupoteriepeopledoc
romgere
romgere
ndekeister-us
ndekeister-us
xcambar
xcambar

License

This project is licensed under the MIT License.

Keywords

FAQs

Package last updated on 02 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc