Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Ember
  3. ember-truth-helpers

ember-truth-helpers

MITTypeScriptv5.0.0

Ember HTMLBars helpers for enhanced conditional logic in templates, including not, and, or, eq, and is-array.

GitHubGitHub
703 stars95 forks0 contributors

What is ember-truth-helpers?

Ember Truth Helpers is an Ember.js addon that provides a set of HTMLBars template helpers to extend the conditional logic capabilities of `if` and `unless` statements. It simplifies complex boolean expressions directly in templates, improving readability and reducing the need for JavaScript in component logic.

Target Audience

Ember.js developers building applications with HTMLBars templates who need more expressive conditional logic in their templates without resorting to JavaScript in components.

Value Proposition

Developers choose this addon because it offers a declarative, concise way to handle complex boolean logic in templates, following Ember's conventions while providing JavaScript-like expressions, and it includes TypeScript definitions for Glint support and compatibility with modern Ember tooling like Single File Components.

Overview

Ember HTMLBars Helpers for {{if}} & {{unless}}: not, and, or, eq & is-array

Use Cases

Best For

  • Simplifying complex boolean expressions in Ember HTMLBars templates without writing JavaScript in components.
  • Performing numeric comparisons (greater than, less than, etc.) directly within template conditionals.
  • Implementing logical operations (AND, OR, XOR, NOT) with support for variable arguments in templates.
  • Checking array types, emptiness, or deep equality using Ember's utilities in template logic.
  • Enhancing type safety in Ember projects using Glint with built-in TypeScript definitions.
  • Using conditional helpers in modern Ember Single File Components (.gts or .gjs files).

Not Ideal For

  • Projects not using Ember.js or its HTMLBars templating system.
  • Teams enforcing a strict separation of concerns who prefer all logic in JavaScript/TypeScript, not templates.
  • Applications with simple conditional logic where native `if` and `unless` are sufficient.
  • Legacy Ember projects below version 4.8 that cannot upgrade to modern tooling.

Pros & Cons

Pros

Declarative Template Logic

Allows complex boolean expressions like `{{if (and a b c)}}` directly in templates, improving readability and reducing JavaScript in components as per the README's philosophy.

Comprehensive Helper Set

Includes helpers for equality, logical operations (AND, OR, XOR, NOT), numeric comparisons, and array checks, covering a wide range of conditional needs without custom code.

Modern Ember Integration

Supports Ember v4.8+, Glint for TypeScript, and Single File Components (.gts/.gjs), aligning with current Ember best practices and tooling.

Variable Argument Support

Helpers like `and`, `or`, and `not` accept variable numbers of arguments, providing flexibility similar to JavaScript operators for complex conditions.

Cons

Framework Lock-in

Exclusively designed for Ember.js with HTMLBars, making it unusable in other JavaScript frameworks or vanilla projects, limiting portability.

Migration Overhead

Requires Ember v4.8+ and compatibility with Embroider or ember-auto-import v2, which can be a barrier for teams with older codebases needing upgrades.

Deep Equality Limitations

The `eq` helper only handles shallow equality; for complex objects, `is-equal` is needed, which relies on Ember's `isEqual` and might not cover all edge cases efficiently.

Frequently Asked Questions

Quick Stats

Stars703
Forks95
Contributors0
Open Issues11
Last commit2 months ago
CreatedSince 2015

Tags

#javascript-framework#template-helpers#ember-addon#glint#frontend#type-safe#conditional-logic

Built With

G
Glint
E
Ember.js
T
TypeScript
H
HTMLBars

Included in

Ember202
Auto-fetched 1 hour ago

Related Projects

ember-composable-helpersember-composable-helpers

Composable helpers for declarative templating in Ember

Stars629
Forks122
Last commit2 years ago
ember-route-action-helperember-route-action-helper

Bubble closure actions in routes

Stars326
Forks44
Last commit3 years ago
ember-promise-helpersember-promise-helpers

Promise-y sugar for your Ember templates.

Stars206
Forks24
Last commit2 years ago
ember-awesome-macrosember-awesome-macros

A collection of Ember computed macros

Stars204
Forks36
Last commit2 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub