https://github.com/hexlet-components/js-co
https://github.com/hexlet-components/js-co
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hexlet-components/js-co
- Owner: hexlet-components
- Created: 2016-10-15T18:02:44.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2024-09-05T07:31:14.000Z (almost 2 years ago)
- Last Synced: 2025-10-06T08:21:25.138Z (9 months ago)
- Language: JavaScript
- Size: 1.52 MB
- Stars: 2
- Watchers: 8
- Forks: 1
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# js-co
[](https://github.com/hexlet-components/js-co/actions)
## Install
```sh
npm install @hexlet/co
```
## Usage example
```javascript
import co from '@hexlet/co';
co(function* () {
const result = yield Promise.resolve(true);
return result;
}).then(value => {
console.log(value);
}, err => {
console.error(err.stack);
});
// => true
```
For more information, see the [Full Documentation](https://github.com/hexlet-components/js-co/tree/master/docs)
---
[](https://hexlet.io?utm_source=github&utm_medium=link&utm_campaign=js-co)
This repository is created and maintained by the team and the community of Hexlet, an educational project. [Read more about Hexlet](https://hexlet.io?utm_source=github&utm_medium=link&utm_campaign=js-co).
See most active contributors on [hexlet-friends](https://friends.hexlet.io/).