co
npmv4.6.0generator async control flow goodness
Not recommended for new projects
No — co should not be adopted for new projects. Last published 4080 days ago.
- AAdoption: grade A, Excellent.
31.2M downloads per week and 4 known dependents.
- FMaintenance: grade F, Failing.
Last published 4080 days ago.
- AWeight: grade A, Excellent.
Zero runtime dependencies.
- ASupply chain: grade A, Excellent.
No install scripts, 3 maintainers, and a contained dependency surface.
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding co to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Compatibility
- Node.js
- iojs >= 1.0.0, node >= 0.12.0
- Module format
- CommonJS only
- TypeScript
- No bundled types
- Install scripts
- None
Quick start
A usage example from the co README.
co(function* () {
var result = yield Promise.resolve(true);
return result;
}).then(function (value) {
console.log(value);
}, function (err) {
console.error(err.stack);
});co vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| cothis page | 31.2M | 4 | MIT | 11 years ago |
| quansync | 0 | 1 | MIT | 1 day ago |
| regenerator-runtime | 0 | 4 | MIT | 1 day ago |
| await-lock | 0 | 1 | MIT | 1 day ago |
| p-limit | 293.1M | 5 | MIT | 1 day ago |
| p-locate | 216.9M | 1 | MIT | 1 day ago |
Dependencies
Declared by co v4.6.0. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (4)
Used by
Popular packages that depend on co.
PostgreSQL client - pure javascript & libpq with the same API
Connection pool for node-postgres
Mutex locks for async functions
[type-definitions]: https://github.com/jestjs/jest/blob/main/packages/jest-types/src/Circus.ts
Relationship graph
Dependencies (left) and dependents (right) of co.
Frequently installed together
TypeScript definitions for node
A socket implementation that can run on Cloudflare Workers using native TCP connections.
Run multiple promise-returning & async functions with limited concurrency
This packages is a collection of utilities and helper functions
No description provided.
Captures and cleans stack traces
Parameterised tests for Jest
This package contains shared types of Jest's packages.
A drop-in replacement for fs, making various improvements.
Convert Windows backslash paths to slash paths
Stringify any JavaScript value.
No description provided.
Release history
No releases in the last two years, typically about 19 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 4.6.0latest | 11 years ago | — | MIT |
| 4.5.4 | 11 years ago | — | MIT |
| 4.5.2 | 11 years ago | — | MIT |
| 4.5.1 | 11 years ago | — | MIT |
| 4.5.0 | 11 years ago | — | MIT |
| 4.4.0 | 11 years ago | — | MIT |
| 4.3.1 | 11 years ago | — | MIT |
| 4.3.0 | 11 years ago | — | MIT |
| 4.2.0 | 11 years ago | — | MIT |
| 4.1.0 | 11 years ago | — | MIT |
| 4.0.2 | 11 years ago | — | MIT |
| 4.0.1 | 11 years ago | — | MIT |
| 4.0.0 | 11 years ago | — | MIT |
| 3.1.0 | 12 years ago | — | MIT |
| 3.0.6 | 12 years ago | — | MIT |
Overview
co is an npm package that generator async control flow goodness. It is extremely widely used, with about 31.2M downloads per week and 4 known dependents in the graph. The latest version is 4.6.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need generator async control flow goodness and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (31.2M weekly downloads).
- Clear open-source license (MIT).
Cons
- No bundled TypeScript types (may require a separate @types package).
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Frequently asked questions
Should I use co?
No — co should not be adopted for new projects. Last published 4080 days ago.
How do I install co?
Run `npm install co` to add co to your npm project.
What license is co released under?
co is distributed under the MIT license.
How popular is co?
co has approximately 31,179,148 downloads per week and 4 known dependent packages.
Is co still maintained?
The most recent release of co (v4.6.0) was published 11 years ago.
Does co run install scripts?
No. co does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.