time-to-botec/squiggle/node_modules/@stdlib/assert/has-async-await-support/README.md
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00

2.4 KiB

Async/Await Support

Detect native async/await support.

Usage

var hasAsyncAwaitSupport = require( '@stdlib/assert/has-async-await-support' );

hasAsyncAwaitSupport()

Detects if a runtime environment supports ES2017 async/await.

var bool = hasAsyncAwaitSupport();
// returns <boolean>

Notes

  • The implementation uses code evaluation, which may be problematic in browser contexts enforcing a strict content security policy (CSP).

Examples

var hasAsyncAwaitSupport = require( '@stdlib/assert/has-async-await-support' );

var bool = hasAsyncAwaitSupport();
if ( bool ) {
    console.log( 'Environment has native async/await support.' );
} else {
    console.log( 'Environment lacks native async/await support.' );
}

CLI

Usage

Usage: has-async-await-support [options]

Options:

  -h,    --help                Print this message.
  -V,    --version             Print the package version.

Examples

$ has-async-await-support
<boolean>