Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

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

TermsPrivacyAboutGitHubRSS
  1. Home
  2. JavaScript
  3. when.js

when.js

NOASSERTIONJavaScript3.7.8

A Promises/A+ and when() implementation with async utilities for JavaScript.

GitHubGitHub
3.4k stars382 forks0 contributors

What is when.js?

When.js is a Promises/A+ compliant library that provides a fast `when()` implementation and additional async utilities for JavaScript. It simplifies managing complex callback flows by converting them into promise-based APIs, improving code readability and maintainability.

Target Audience

JavaScript developers working with asynchronous operations, especially those needing Promises/A+ compliance, ES6 Promise support, or utilities for handling promise collections and task execution.

Value Proposition

Developers choose When.js for its combination of small size, high performance, debuggability, and rich features like promise collection resolution and callback transformation, making it a robust alternative to native promises or other promise libraries.

Overview

A solid, fast Promises/A+ and when() implementation, plus other async goodies.

Use Cases

Best For

  • Converting Node-style callback APIs to promise-based APIs
  • Handling arrays or hashes of promises with built-in resolution methods
  • Executing asynchronous tasks in parallel or sequential order
  • Adding ES6 Promise support to environments lacking native implementation
  • Simplifying complex nested callback flows in JavaScript applications
  • Debugging asynchronous code with enhanced debuggability features

Not Ideal For

  • Projects exclusively using modern JavaScript with async/await and no need for promise chaining utilities
  • Teams prioritizing minimal bundle size who can rely on native promises or lighter polyfills
  • Applications requiring advanced promise features like cancellation or timeout management not supported by When.js

Pros & Cons

Pros

Promises/A+ Compliance

Ensures full interoperability with other promise libraries, making it a reliable choice for mixed environments as stated in the key features.

ES6 Promise Shim

Provides a complete shim for environments lacking native ES6 Promise support, enhancing cross-platform compatibility without extra configuration.

Rich Collection Handling

Includes methods to resolve arrays, hashes, and sequences of promises, simplifying complex asynchronous operations as highlighted in the README examples.

Callback Transformation

Converts Node-style and callback-based APIs into promises, reducing callback hell and improving code maintainability with built-in utilities.

Performance and Size

Emphasizes small size and high performance, offering efficient async utilities without unnecessary bloat per the project philosophy.

Cons

Limited Advanced Features

Lacks built-in support for promise cancellation or timeout management, which are available in competing libraries like Bluebird.

Smaller Ecosystem

Has a smaller community and fewer third-party integrations compared to more popular promise libraries, potentially limiting resources and plugins.

Extra Dependency Overhead

Introduces an additional library in projects where native promises could suffice, increasing bundle size and maintenance complexity.

Frequently Asked Questions

Quick Stats

Stars3,421
Forks382
Contributors0
Open Issues59
Last commit4 years ago
CreatedSince 2011

Tags

#commonjs#async-utilities#amd#nodejs#javascript-library#task-execution#promises-aplus

Built With

J
JavaScript

Included in

JavaScript34.9kPromises1.7k
Auto-fetched 9 hours ago

Related Projects

asyncasync

Async utilities for node and the browser

Stars28,132
Forks2,377
Last commit1 month ago
bluebirdbluebird

:bird: :zap: Bluebird is a full featured promise library with unmatched performance.

Stars20,488
Forks2,310
Last commit1 year ago
QQ

A promise library for JavaScript

Stars15,010
Forks1,179
Last commit2 years ago
rsvp.jsrsvp.js

A lightweight library that provides tools for organizing asynchronous code

Stars3,594
Forks259
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