String helpers for Ember. Extracted from the great DockYard's ember-composable-helpers.
To install:
ember install ember-cli-string-helpers
This addon performs optional tree-shaking – you can specify which helpers to whitelist or blacklist using only or except within your config/environment.js:
module.exports = function(environment) {
var ENV = {
'ember-cli-string-helpers': {
only: ['dasherize', 'underscore'],
except: ['titleize', 'capitalize']
}
};Both only and except can be safely used together (the addon computes the diff), although it's best if you only use one for your own sanity.
except: ['camelize'] // imports all helpers except `camelize`
only: ['camelize'] // imports only `camelize`camelizecapitalizeclassifydasherizehtml-safehumanizelowercasetruncatetitleizeunderscoreuppercasew
Camelizes a string using Ember.String.camelize.
Capitalizes a string using Ember.String.capitalize.
Classifies a string using Ember.String.classify.
Dasherizes a string using Ember.String.dasherize.
Mark a string as safe for unescaped output with Ember templates using Ember.String.htmlSafe.
Removes dashes and underscores from a string, capitalizes the first letter and makes the rest of the string lower case.
Lowercases a string
Titleizes a string
Truncates a string with a characterLimit.
Capitalizes a string using Ember.String.underscore.
Uppercases a string
Splits a string on whitespace and/or turns multiple words into an array
or:
See also: Ember w documentation