dynamsoft-barcode-reader-bundle 11.0.3000-beta-202507082223 → 11.0.3000

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.html CHANGED
@@ -277,7 +277,10 @@ Thanks to its simplified APIs and built-in UI for video streaming, you can imple
277
277
  <span class="hljs-function">(<span class="hljs-params"><span class="hljs-keyword">async</span> (</span>) =&gt;</span> {
278
278
  <span class="hljs-comment">// Launch the scanner and wait for the result</span>
279
279
  <span class="hljs-keyword">const</span> result = <span class="hljs-keyword">await</span> barcodeScanner.launch();
280
- alert(result.barcodeResults[<span class="hljs-number">0</span>].text);
280
+ <span class="hljs-comment">// Display the first detected barcode's text in an alert</span>
281
+ <span class="hljs-keyword">if</span> (result.barcodeResults.length) {
282
+ alert(result.barcodeResults[<span class="hljs-number">0</span>].text);
283
+ }
281
284
  })();
282
285
  </span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
283
286
  <span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
@@ -334,7 +337,7 @@ Thanks to its simplified APIs and built-in UI for video streaming, you can imple
334
337
  <ul>
335
338
  <li><p>From the website</p>
336
339
  <p><a href="https://www.dynamsoft.com/barcode-reader/downloads/?ver=11.0.30&utm_source=npm&product=dbr&package=js">Download Dynamsoft Barcode Reader JavaScript Package</a></p>
337
- <p>The resources are located at path <code>dynamsoft/distributables/</code>.</p></li>
340
+ <p>The resources are located in the <code>./dist/</code> directory.</p></li>
338
341
  <li><p>From npm</p></li>
339
342
  </ul>
340
343
  <pre><code class="hljs sh language-sh"> npm i dynamsoft-barcode-reader-bundle@11.0.3000
@@ -372,7 +375,10 @@ Thanks to its simplified APIs and built-in UI for video streaming, you can imple
372
375
  <pre><code class="hljs js language-js">(<span class="hljs-keyword">async</span> () =&gt; {
373
376
  <span class="hljs-comment">// Launch the scanner and wait for the result</span>
374
377
  <span class="hljs-keyword">const</span> result = <span class="hljs-keyword">await</span> barcodescanner.launch();
375
- alert(result.barcodeResults[<span class="hljs-number">0</span>].text);
378
+ <span class="hljs-comment">// Display the first detected barcode's text in an alert</span>
379
+ <span class="hljs-keyword">if</span> (result.barcodeResults.length) {
380
+ alert(result.barcodeResults[<span class="hljs-number">0</span>].text);
381
+ }
376
382
  })();
377
383
  </code></pre>
378
384
  <p>Now that the Barcode Scanner has been initialized and configured, it is ready to be launched! Upon launch, the Barcode Scanner presents the main <strong><code>BarcodeScannerView</code></strong> UI in its container on the page, and is ready to start scanning. By default, we use the <code>SINGLE</code> scanning mode, which means only one decoding result will be included in the final result. In the code above, we directly alerted the successfully decoded barcode text on the page.</p>
package/README.md CHANGED
@@ -70,7 +70,10 @@ If you are fully satisfied with the solution and would like to move forward with
70
70
  (async () => {
71
71
  // Launch the scanner and wait for the result
72
72
  const result = await barcodeScanner.launch();
73
- alert(result.barcodeResults[0].text);
73
+ // Display the first detected barcode's text in an alert
74
+ if (result.barcodeResults.length) {
75
+ alert(result.barcodeResults[0].text);
76
+ }
74
77
  })();
75
78
  </script>
76
79
  </body>
@@ -147,7 +150,7 @@ Alternatively, you may choose to download the SDK and host the files on your own
147
150
 
148
151
  [Download Dynamsoft Barcode Reader JavaScript Package](https://www.dynamsoft.com/barcode-reader/downloads/?ver=11.0.30&utm_source=npm&product=dbr&package=js)
149
152
 
150
- The resources are located at path `dynamsoft/distributables/`.
153
+ The resources are located in the `./dist/` directory.
151
154
 
152
155
  - From npm
153
156
 
@@ -200,7 +203,10 @@ const barcodescanner = new Dynamsoft.BarcodeScanner({
200
203
  (async () => {
201
204
  // Launch the scanner and wait for the result
202
205
  const result = await barcodescanner.launch();
203
- alert(result.barcodeResults[0].text);
206
+ // Display the first detected barcode's text in an alert
207
+ if (result.barcodeResults.length) {
208
+ alert(result.barcodeResults[0].text);
209
+ }
204
210
  })();
205
211
  ```
206
212