npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@emberx/helper

v0.5.0

Published

Template helpers for emberx, with owner services injected as a third argument

Readme

@emberx/helper - Reactive UI functions for node.js and browser

EmberX helpers are UI functions that return data when its parameters or related services state changes:

import assert from 'node:assert/strict';
import helper from '@emberx/helper';
import Component, { service, tracked, action, hbs, renderComponent, didRender } from '@emberx/component';

// A helper receives positional params, named params, and the owner's services:
const translate = helper(([key], _named, services) => services.intl.t(key));

class Intl {
  @tracked accessor currentLocale = 'en';

  translations = {
    en: { 'button.save': 'Save model' },
    es: { 'button.save': 'Guardar modelo' },
  };

  t(key) {
    return this.translations[this.currentLocale][key];
  }
}

class UserDisplay extends Component {
  @service intl;

  static includes = { translate };
  static template = hbs`
    <h5 id="locale">Current locale is: {{this.intl.currentLocale}}</h5>
    <button type="button" id="save">{{translate "button.save"}}</button>
    <button type="button" id="change-locale" {{on "click" this.changeLocale}}>Change locale</button>
  `;

  @action changeLocale(): void {
    this.intl.currentLocale = this.intl.currentLocale === 'en' ? 'es' : 'en';
  }
}

await renderComponent(UserDisplay, {
  element: document.getElementById('app'),
  owner: { services: { intl: new Intl() } },
});

assert.equal(document.querySelector('#save').textContent, 'Save model');

// The helper re-runs when the service state it read changes:
document.querySelector('#change-locale').click();
await didRender();

assert.equal(document.querySelector('#save').textContent, 'Guardar modelo');

Built-in helpers

Every template has and, or, not, eq, neq, gt, gte, lt, lte, assign, debug, drop and take in scope, beside Ember's fn, hash, array, get, concat and on. They are emberx's own rather than @ember/helper's, which differ: those treat [] and an empty htmlSafe string as false and follow proxies' isTruthy, throw on any argument count but their own, and Ember's not takes one argument where emberx's is true when every argument is falsy; Ember's comparisons have no forceNumber. From JavaScript, emberx's take their arguments as an array, eq([a, b]), as a template passes them.