---
title: "Are You Async Yet?"
description: "Transitioning from callbacks to async/await in JavaScript. Practical notes and code examples on Are You Async Yet? by in JS."
url: "https://h3manth.com/scribe/are-you-async-yet/"
canonical_url: "https://h3manth.com/scribe/are-you-async-yet/"
markdown_url: "https://h3manth.com/scribe/blog/are-you-async-yet.md"
publishDate: "2015-10-05T00:00:00.000Z"
author: "Hemanth HM"
category: "javascript"
tags: ["javascript","async","es7"]
word_count: 76
reading_time_minutes: 1
x_markdown_tokens: 237
content_signal: "ai-train=yes, search=yes, ai-input=yes"
---

# Are You Async Yet?

> Transitioning from callbacks to async/await in JavaScript. Practical notes and code examples on Are You Async Yet? by in JS.

Building on the [ES7 async-await intro](/es7-async-await), here's how to reach callbackless code.

## Using async-await

```javascript
// With xkcd-imgs module
const xkcd = require('xkcd-imgs');

async function getComic() {
  const comic = await xkcd.random();
  console.log(comic);
}

## With Fetch API
javascript
async function fetchData(url) {
  const response = await fetch(url);
  const data = await response.json();
  return data;
}
```

Use [Babel](https://babeljs.io) to transpile async-await for older environments.

Dive in and enjoy async programming in JavaScript without callbacks!
