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

ember-promise-tools

v1.1.0

Published

A collection of tools to deal with promises easier.

Readme

Build Status npm version Code Climate Test Coverage Dependency Status

ember-promise-tools

This is a collection of tools we built to help deal with and unwrap promises when you know they are already fulfilled.

While you can always use the standard promise resolve mechanisms, if you preload a lot of ember data so that all your relationships are already resolved,

or you are dealing with promises you know were previously resolved and just want access to the fulfilled content, this is a collection of tools to help to do that.

Installation

ember install ember-promise-tools

Documenation

Mixins

Promise Resolver (ember-promise-tools/mixins/promise-resolver)

A Mixin that you can include in any object to give you a promise resolving workflow.

The method signature is:

resolvePromise(maybePromise, immediateResolve, delayedResolve, catchResolve)

maybePromise is the value that may or may not be a promise.

If the value is a promise and is already resolved, or the value isn't a promise, immediateResolve is called.

If it is a promise and needs to wait, then the delayedResolve is called. If you don't pass this method in, immediateResolve will be called in its place.

If it gets an error, the catchResolve is called.

This method is meant to be used as last object in wins. If you pass multiple promises in, only the last one passed in calls callbacks on resolve.

Utils

Is Promise (ember-promise-tools/utils/is-promise)

function(maybePromise)

A simple function where you pass in a value, and it returns true or false if its a promise.

Is Fulfilled (ember-promise-tools/utils/is-fulfilled)

function(maybePromise)

A simple function where you pass in a value, and it returns true or false if the promise is fulfilled.

It is expected that if you call this method, you know its a promise or previously called is-promise util.

This detects fulfilled state only from objects using Ember.PromiseProxyMixin and Ember.RSVP.Promise.

Get Promise Content (ember-promise-tools/utils/get-promise-content)

function(maybePromise)

A simple function where you pass in a value, and it returns the content of a fulfilled promise.

It is expected that if you call this method, you know its a promise and previously fulfilled.

This only returns content from objects using Ember.PromiseProxyMixin and Ember.RSVP.Promise.

Smart Resolve (ember-promise-tools/utils/smart-resolve)

function(maybePromise)

This is a method combining the previously three utilities to try and return the most appropriate value.

If its not a promise, it returns the value.

If it is a promise and the promise is fulfilled, it returns the content.

If it is a promise and the promise isn't fulfilled, it returns the promise.