Skip to content

Instantly share code, notes, and snippets.

@YaoKaiLun
Created January 16, 2018 01:27
Show Gist options
  • Save YaoKaiLun/6edc2e9389c35095049c05612fce9fd0 to your computer and use it in GitHub Desktop.
Save YaoKaiLun/6edc2e9389c35095049c05612fce9fd0 to your computer and use it in GitHub Desktop.
check async support
function supportAsyncFunctions() {
try {
new Function('(async function () {})()');
return true;
} catch (ex) {
return false;
}
}
module.exports = supportAsyncFunctions() ? require('./lib/client.js') : require('./es5/client.js');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment