All Projects → robertklep → Top Level Await

robertklep / Top Level Await

Use `await` at your Node.js code's top level!

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Top Level Await

Preact Cli Plugin Async
Preact CLI plugin that adds converts async/await to Promises.
Stars: ✭ 44 (-65.08%)
Mutual labels:  async-await
Tractor
structured concurrent, Python parallelism
Stars: ✭ 88 (-30.16%)
Mutual labels:  async-await
Hapi Starter Kit
Hapi.js based REST boilerplate which uses latest ES7/ES8 features (async/await) with code coverage and follows best pratices
Stars: ✭ 103 (-18.25%)
Mutual labels:  async-await
Ea Async
EA Async implements async-await methods in the JVM.
Stars: ✭ 1,085 (+761.11%)
Mutual labels:  async-await
Itiriri Async
A library for asynchronous iteration.
Stars: ✭ 78 (-38.1%)
Mutual labels:  async-await
Async Graphql
A GraphQL server library implemented in Rust
Stars: ✭ 1,377 (+992.86%)
Mutual labels:  async-await
Asyncio
asyncio historical repository
Stars: ✭ 952 (+655.56%)
Mutual labels:  async-await
Async Backplane
Simple, Erlang-inspired fault-tolerance framework for Rust Futures.
Stars: ✭ 113 (-10.32%)
Mutual labels:  async-await
Radon
Object oriented state management solution for front-end development.
Stars: ✭ 80 (-36.51%)
Mutual labels:  async-await
Greenletio
Asyncio integration with sync code using greenlets.
Stars: ✭ 102 (-19.05%)
Mutual labels:  async-await
Web Applications With Fastapi Course
Demo code and other handouts for students of our FastAPI Web Apps course.
Stars: ✭ 56 (-55.56%)
Mutual labels:  async-await
Egghead Async Await
Code for my "Asynchronous JavaScript with async/await" egghead.io course:
Stars: ✭ 74 (-41.27%)
Mutual labels:  async-await
Async Ray
Provide async/await callbacks for every, find, findIndex, filter, forEach, map, reduce, reduceRight and some methods in Array.
Stars: ✭ 102 (-19.05%)
Mutual labels:  async-await
Create React Redux App
This project was bootstrapped with Create React App and Redux, Sass Structure.
Stars: ✭ 46 (-63.49%)
Mutual labels:  async-await
Riprova
Versatile async-friendly library to retry failed operations with configurable backoff strategies
Stars: ✭ 106 (-15.87%)
Mutual labels:  async-await
Uvloop
Ultra fast asyncio event loop.
Stars: ✭ 8,246 (+6444.44%)
Mutual labels:  async-await
React Prepare
Prepare you app state for async server-side rendering and more!
Stars: ✭ 100 (-20.63%)
Mutual labels:  async-await
Cargo Wharf
Cacheable and efficient Docker images builder for Rust
Stars: ✭ 117 (-7.14%)
Mutual labels:  async-await
Aiormq
Pure python AMQP 0.9.1 asynchronous client library
Stars: ✭ 112 (-11.11%)
Mutual labels:  async-await
Configureawaitchecker
ConfigureAwait Checker for ReSharper and Rider
Stars: ✭ 101 (-19.84%)
Mutual labels:  async-await

top-level-await (PoC)

Allow using await at your code's top level. Requires Node.js v7.6.0 or higher.

Not this:

// 💩
(async function() {
  console.log(await Promise.resolve('hello world'));
})();

But this:

// 🎉
console.log(await Promise.resolve('hello world'));

Installation

npm i top-level-await

Usage

It's a two-step process: first require() this module, then require() the rest of your code:

// bootstrap.js
require('top-level-await');
require('./app');

Inside app.js, you can use await whenever you like.

You can also tell Node to require the module for you, instead of using a separate bootstrap script:

$ node -r top-level-await app

Which works for CLI tools too:

#!/usr/bin/env node -r top-level-await

console.log( await Promise.resolve('hello world') );

How?

By hacking Module.wrap().

This is done without prejudice, so all modules that get loaded after loading this module will be "fixed".

Is it production-ready?

¯\_(ツ)_/¯
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].