Skip to content

Commit 54d3ff4

Browse files
Add documentation for the contents of the dist folder in dynamsoft-barcode-reader-bundle
1 parent 971c369 commit 54d3ff4

1 file changed

Lines changed: 71 additions & 0 deletions

File tree

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
layout: default-layout
3+
title: What's in the dist Folder of dynamsoft-barcode-reader-bundle?
4+
keywords: Dynamsoft Barcode Reader, FAQ, JavaScript, tech basic, wasm, dist, files
5+
description: How to enable -SIMD-Pthread Wasm for accelerated deep learning computation?
6+
needAutoGenerateSidebar: false
7+
---
8+
9+
# What's in the dist Folder of dynamsoft-barcode-reader-bundle?
10+
11+
When you install or extract the `dynamsoft-barcode-reader-bundle` package (from npm, CDN or zip installer), the `dist/` directory contains all the compiled, ready-to-use JavaScript/WebAssembly assets necessary to run the barcode reader in a browser or web app.
12+
13+
Below are the common files you'll find and their purposes.
14+
15+
---
16+
17+
## 1. dbr.bundle.js
18+
19+
**Description:**
20+
21+
- The main bundled JavaScript file for the barcode reader SDK
22+
- Include this in your web page to use the SDK without separate imports
23+
24+
---
25+
26+
## 2. dbr.bundle.mjs (ES Module)
27+
28+
**Description:**
29+
30+
- An ES Module version of the bundled SDK
31+
- Useful when using modern build tools like Webpack, Vite, or Rollup
32+
33+
---
34+
35+
## 3. TypeScript Definition Files
36+
37+
**Files:** `dbr.bundle.d.ts` / `dbr.bundle.esm.d.ts`
38+
39+
**Description:**
40+
41+
- Type definitions for TypeScript support
42+
- Provides autocompletion and improves developer experience in TypeScript projects
43+
44+
---
45+
46+
## 4. WebAssembly Engine Files
47+
48+
`dynamsoft-barcode-reader-bundle` requires WASM and Worker scripts to work together in order to achieve highly efficient decoding capabilities.
49+
50+
| File | Purpose |
51+
|------|---------|
52+
| `*.wasm` | Core barcode reading logic compiled to WebAssembly |
53+
| `*.wasm.js` | JavaScript loader/bootstrap for the `.wasm` file |
54+
| `*.worker.js` | Offloads processing to a background thread |
55+
56+
> [!IMPORTANT]
57+
> The dbr-bundle dynamically selects the most suitable WebAssembly variant based on the current browser environment, in order to maximize browser performance as much as possible. This means that in most cases, only one set of `*.wasm` + `*.wasm.js` files will actually be used at runtime.
58+
> For details about the different WASM variants, please refer to [What Is Adaptive WebAssembly (Wasm) Loading and How Does It Work?](adaptive-wasm-loading.md).
59+
60+
---
61+
62+
## 5. Other Auxiliary Resources
63+
64+
These folders collectively compose the runtime environment for a JavaScript-based barcode scanner application, providing all necessary assets for ML-based scanning, data parsing, result rendering, and user interaction.
65+
66+
| Folder | Purpose |
67+
|------|---------|
68+
| `models` | Contains pre-trained machine learning models used for barcode detection and recognition. These models enable the scanner to identify and decode various barcode formats from images and video streams in real-time. |
69+
| `parser-resources` | Stores resources required for data parsing and interpretation. |
70+
| `templates` | Contains preset CaptureVisionTemplates used for different barcode scanning scenarios. |
71+
| `ui` | Preset ui in `.html` files. |

0 commit comments

Comments
 (0)