README.md (2232B)
1 <!-- 2 3 @license Apache-2.0 4 5 Copyright (c) 2018 The Stdlib Authors. 6 7 Licensed under the Apache License, Version 2.0 (the "License"); 8 you may not use this file except in compliance with the License. 9 You may obtain a copy of the License at 10 11 http://www.apache.org/licenses/LICENSE-2.0 12 13 Unless required by applicable law or agreed to in writing, software 14 distributed under the License is distributed on an "AS IS" BASIS, 15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 See the License for the specific language governing permissions and 17 limitations under the License. 18 19 --> 20 21 # Async Iterator Symbol Support 22 23 > Detect native [`Symbol.asyncIterator`][mdn-symbol] support. 24 25 <section class="usage"> 26 27 ## Usage 28 29 <!-- eslint-disable id-length --> 30 31 ```javascript 32 var hasAsyncIteratorSymbolSupport = require( '@stdlib/assert/has-async-iterator-symbol-support' ); 33 ``` 34 35 #### hasAsyncIteratorSymbolSupport() 36 37 Detects if a runtime environment supports ES2018 [`Symbol.asyncIterator`][mdn-symbol]. 38 39 <!-- eslint-disable id-length --> 40 41 ```javascript 42 var bool = hasAsyncIteratorSymbolSupport(); 43 // returns <boolean> 44 ``` 45 46 </section> 47 48 <!-- /.usage --> 49 50 <section class="examples"> 51 52 ## Examples 53 54 <!-- eslint-disable id-length --> 55 56 <!-- eslint no-undef: "error" --> 57 58 ```javascript 59 var hasAsyncIteratorSymbolSupport = require( '@stdlib/assert/has-async-iterator-symbol-support' ); 60 61 var bool = hasAsyncIteratorSymbolSupport(); 62 if ( bool ) { 63 console.log( 'Environment has Symbol.asyncIterator support.' ); 64 } else { 65 console.log( 'Environment lacks Symbol.asyncIterator support.' ); 66 } 67 ``` 68 69 </section> 70 71 <!-- /.examples --> 72 73 * * * 74 75 <section class="cli"> 76 77 ## CLI 78 79 <section class="usage"> 80 81 ### Usage 82 83 ```text 84 Usage: has-async-iterator-symbol-support [options] 85 86 Options: 87 88 -h, --help Print this message. 89 -V, --version Print the package version. 90 ``` 91 92 </section> 93 94 <!-- /.usage --> 95 96 <section class="examples"> 97 98 ### Examples 99 100 ```bash 101 $ has-async-iterator-symbol-support 102 <boolean> 103 ``` 104 105 </section> 106 107 <!-- /.examples --> 108 109 </section> 110 111 <!-- /.cli --> 112 113 <section class="links"> 114 115 [mdn-symbol]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol 116 117 </section> 118 119 <!-- /.links -->