co is a small Node.js library that popularized generator-based coroutines to write asynchronous code that looks synchronous. By yielding promises (or thunks) inside a generator function, co resumes execution when the asynchronous work completes, eliminating deeply nested callbacks. It supports yielding arrays or objects of promises to run tasks concurrently, and it propagates errors naturally through try/catch, making control flow easier to reason about. The library arrived before async/await existed in Node.js and influenced how developers thought about structuring asynchronous programs. Even in a world with native async functions, co remains a concise illustration of cooperative concurrency and still works where generator syntax is preferred. Its API surface is intentionally tiny: wrap a generator, yield work, and let co drive the promise plumbing behind the scenes.

Features

  • Generator-driven coroutines that yield promises or thunks
  • Natural error handling with try/catch around asynchronous code
  • Concurrency via yielding arrays or objects of promises
  • Simple API that turns a generator into a promise
  • Plays well with existing promise libraries and Node callbacks
  • Historical stepping stone that influenced async/await ergonomics

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

MIT License

Follow co

co Web Site

Other Useful Business Software
99.99% Uptime for MySQL and PostgreSQL Databases Icon
99.99% Uptime for MySQL and PostgreSQL Databases

Sub-second maintenance. 2x read/write performance. Built-in vector search for AI apps.

Cloud SQL Enterprise Plus delivers near-zero downtime with 35 days of point-in-time recovery. Supports MySQL, PostgreSQL, and SQL Server.
Try Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of co!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Libraries

Registered

2025-10-23