Skip to content

check if async/await is available, it can run in browser and nodejs

License

Notifications You must be signed in to change notification settings

RIO-LI/is-async-await-supported

Repository files navigation

is-async-await-supported

Check if async/await is available

install

Browser/AMD

download the latest release from link

NPM

npm install --save is-async-await-supported

How to use

Browser

isAsyncAwaitSupport(); // true means async/await is available

AMD

require(['${your path}/is-async-await-supported.min'], function (util) {
    console.log(util.isAsyncAwaitSupport());
})

CMD/Nodejs/webpack

const isAsyncAwaitSupport = require('is-async-await-supported').isAsyncAwaitSupport;
isAsyncAwaitSupport(); // true means async/await is available

ES2015+ with webpack or TypeScript with webpack

import { isAsyncAwaitSupport } from 'is-async-await-supported';

isAsyncAwaitSupport(); // true means async/await is available

ES2015+ without webpack

import { isAsyncAwaitSupport } from '${your path}/is-async-await-supported.esm.js';
isAsyncAwaitSupport(); // true means async/await is available

About

check if async/await is available, it can run in browser and nodejs

Resources

License

Stars

Watchers

Forks

Packages

No packages published