Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
/ co-to-async Public archive

🦄 Take the step from co.wrap to async/await automagically

Notifications You must be signed in to change notification settings

albinekb/co-to-async

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

co-to-async

⚠️⚠️⚠️ ARCHIVED - This tool is no longer useful, native promises have been around for a while now ;) ⚠️⚠️⚠️

Are you using co?

This CLI utility will help you convert your code to use native async/await

example

Before:

const fn = co.wrap(function* (val) {
  return yield Promise.resolve(val);
})

fn(true).then(function (val) {

})

After:

const fn = async function (val) {
  return await Promise.resolve(val);
}

fn(true).then(function (val) {

})

install

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

🎉

About

🦄 Take the step from co.wrap to async/await automagically

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published