Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/albinekb/co-to-async
🦄 Take the step from co.wrap to async/await automagically
https://github.com/albinekb/co-to-async
ast cli co codemod jscodeshift transform
Last synced: 3 months ago
JSON representation
🦄 Take the step from co.wrap to async/await automagically
- Host: GitHub
- URL: https://github.com/albinekb/co-to-async
- Owner: albinekb
- Archived: true
- Created: 2016-09-17T18:46:40.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-09T06:29:46.000Z (about 2 years ago)
- Last Synced: 2024-10-15T09:08:54.846Z (4 months ago)
- Topics: ast, cli, co, codemod, jscodeshift, transform
- Language: JavaScript
- Homepage:
- Size: 298 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-codemods - co-to-async - Take the step from co.wrap to async/await automagically. (JavaScript)
README
# co-to-async
# ⚠️⚠️⚠️ ARCHIVED - This tool is no longer useful, native promises have been around for a while now ;) ⚠️⚠️⚠️
## Are you using [co](github.com/tj/co)?
This CLI utility will help you convert your code to use native **async/await**
### example
Before:```js
const fn = co.wrap(function* (val) {
return yield Promise.resolve(val);
})fn(true).then(function (val) {
})
```After:
```js
const fn = async function (val) {
return await Promise.resolve(val);
}fn(true).then(function (val) {
})
```## install
```sh
npm install --global co-to-async
```## usage
Run `co-to-async` in a project folder, **this will not change any files**
When you're ready to make the changes, run `co-to-async --save`
*Get more help via `co-to-async --help`*
🎉