An open API service indexing awesome lists of open source software.

https://github.com/nfcampos/await-outside

Await outside of async functions
https://github.com/nfcampos/await-outside

async-await node repl

Last synced: 4 months ago
JSON representation

Await outside of async functions

Awesome Lists containing this project

README

        

[![Build Status](https://travis-ci.org/SemraSh/await-outside.svg?branch=master)](https://travis-ci.org/SemraSh/await-outside)

# `await-outside`
## A better Node REPL for asynchronous exploration

Inspired by https://github.com/princejwesley/Mancy.

### From This

```
$ node
> const request = require('superagent')
undefined
> request.get('https://www.googleapis.com/books/v1/volumes').
... query({key: 'NOT_A_VALID_API_KEY'}).
... query({q: 'paul auster'}).
... then(r => r.body)
Promise { }
>
```

### To This

```
$ await-outside
> const request = require('superagent')
undefined
> await request.get('https://www.googleapis.com/books/v1/volumes').
... query({key: 'NOT_A_VALID_API_KEY'}).
... query({q: 'paul auster'}).
... then(r => r.body)
{ kind: 'books#volumes',
totalItems: 2342,
items: [ ... ] }
>
```