1. is-async-supported
Check if async/await is available
is-async-supported
Package: is-async-supported
Created by: timneutkens
Last modified: Sun, 19 Jun 2022 02:36:58 GMT
Version: 1.2.0
License: MIT
Downloads: 79,266
Repository: https://github.com/timneutkens/is-async-supported

Install

npm install is-async-supported
yarn add is-async-supported

is-async-supported

Check if async/await is available

Installation

npm install is-async-supported

Usage

const isAsyncSupported = require('is-async-supported')

if(!isAsyncSupported()) {
  // Load runtime transform
}

Background

This package gives you the ability to load for example async-to-gen only when your Node.js environment doesn't support async/await.

At the moment this is not suitable for checking in browsers since it depends on the VM module provided by Node.js

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code