
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
ember-cli-string-helpers
Advanced tools
String helpers for Ember. Extracted from the great DockYard's ember-composable-helpers.
[!WARNING]
If you are using single file components you most likely do not need this addon as it's just a wrapper on@ember/string
methods. You can import most methods directly from@ember/string
in your components, or migrate to something like change-case.
ember install ember-cli-string-helpers
camelize
Camelizes a string using Ember.String.camelize
.
{{camelize "hello jim bob"}}
{{camelize stringWithDashes}}
Output: helloJimBob
capitalize
Capitalizes a string using Ember.String.capitalize
.
{{capitalize "hello jim bob"}}
{{capitalize fullName}}
Output: Hello jim bob
classify
Classifies a string using Ember.String.classify
.
{{classify "hello jim bob"}}
{{classify stringWithDashes}}
Output: HelloJimBob
dasherize
Dasherizes a string using Ember.String.dasherize
.
{{dasherize "whatsThat"}}
{{dasherize phrase}}
Output: whats-that
html-safe
Mark a string as safe for unescaped output with Ember templates using Ember.String.htmlSafe
.
{{html-safe "<div>someString</div>"}}
{{html-safe unsafeString}}
humanize
Removes dashes and underscores from a string, capitalizes the first letter and makes the rest of the string lower case.
{{humanize "some-string"}}
{{humanize phrase}}
Output: Some string
lowercase
Lowercases a string.
{{lowercase "People Person's Paper People"}}
{{lowercase phrase}}
Output: people person's paper people
titleize
Capitalizes every word separated by a white space or a dash.
{{titleize "my big fat greek wedding"}}
{{titleize phrase}}
Output: My Big Fat Greek Wedding
trim
Trim a string.
{{trim " Lorem ipsum dolor sit amet, consectetur adipiscing elit. "}}
{{trim phrase}}
Output: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
truncate
Truncates a string with a characterLimit and optionally adds an ellipsis to the end.
{{truncate "Lorem ipsum dolor sit amet, consectetur adipiscing elit." 20 true}}
{{truncate phrase characterLimit useEllipsis}}
Output: Lorem ipsum dolor...
underscore
Underscores a string using Ember.String.underscore
.
{{underscore "whatsThat"}}
{{underscore phrase}}
Output: whats_that
uppercase
Uppercases a string.
{{uppercase "loud noises"}}
{{uppercase phrase}}
Output: LOUD NOISES
w
Splits a string on whitespace and/or turns multiple words into an array.
{{#each (w "First" "Second" "Last") as |rank|}}
Our {{rank}} place winner is ...
{{/each}}
or:
{{#each (w "First Second Last") as |rank|}}
Our {{rank}} place winner is ...
{{/each}}
See also: Ember w
documentation
If you are using Glint and environment-ember-loose
, you can add all the helpers to your app at once by adding
import type EmberCliStringHelpersRegistry from 'ember-cli-string-helpers/template-registry';
to your app's e.g. types/glint.d.ts
file, and making sure your registry extends from EmberCliStringHelpersRegistry:
declare module '@glint/environment-ember-loose/registry' {
export default interface Registry
extends EmberCliStringHelpersRegistry {
// ...
}
}
import { camelize } from 'ember-cli-string-helpers';
<template>
{{camelize "hello jim bob"}}
</template>
This project is licensed under the MIT License.
FAQs
String helpers for Ember
The npm package ember-cli-string-helpers receives a total of 27,871 weekly downloads. As such, ember-cli-string-helpers popularity was classified as popular.
We found that ember-cli-string-helpers demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.