layout | title | description | keywords | needAutoGenerateSidebar | needGenerateH3Content | noTitleIndex | breadcrumbText |
---|---|---|---|---|---|---|---|
default-layout |
Entry Page - Dynamsoft Code Parser JavaScript API version 1.x. |
This is the main page of Dynamsoft Code Parser JavaScript SDK version 2.x API Reference. |
CodeParser, api reference, javascript, js |
true |
true |
true |
API Reference |
The Dynamsoft Code Parser JavaScript library comes with one primary class: CodeParser
.
A CodeParser takes code data in forms of byte array or plain string as input and returns parsed results. The following code snippet shows its basic usage:
let parser = await Dynamsoft.DCP.CodeParser.createInstance();
parser.setCodeFormat(enumcodeformat);
let result = await parser.parseData(code);
console.log(result);
The APIs for this class include:
API Name | Description |
---|---|
license | Initializes license of DCP. |
API Name | Description |
---|---|
engineResourcePath | Specifies the path of WASM engine. |
loadWasm() | Loads and compiles the WASM. |
API Name | Description |
---|---|
createInstance() | Creates a CodeParser instance. |
destroyContext() | Destroys the CodeParser instance in WASM. |
API Name | Description |
---|---|
setCodeFormat() | Sets input code's format. |
API Name | Description |
---|---|
parseData() | Parses code data for readable results. |
In order to make the code more predictable and readable, the library defines a series of supporting interfaces and enumerations: