Resource Base
Table of contents

JavaScript API Reference

The Dynamsoft Code Parser JavaScript library comes with one primary class: CodeParser.

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:

Initialize License

API Name Description
license Initializes license of DCP.

Initialize Engine

API Name Description
engineResourcePath Specifies the path of WASM engine.
loadWasm() Loads and compiles the WASM.

Create and Destroy

API Name Description
createInstance() Creates a CodeParser instance.
destroyContext() Destroys the CodeParser instance in WASM.

Set Code Format

API Name Description
setCodeFormat() Sets input code’s format.

Parse Code Data

API Name Description
parseData() Parses code data for readable results.

Interfaces and Enums

In order to make the code more predictable and readable, the library defines a series of supporting interfaces and enumerations:

Interfaces

Enums

This page is compatible for:

Version 1.0

Is this page helpful?

YesYes NoNo

In this article:

version 1.1.0

  • Latest version(2.2.10)
  • Version 2.x
    • Version 2.0.20
  • Version 1.x
    • Version 1.1.0
    • Version 1.0.2
Change +
© 2003–2024 Dynamsoft. All rights reserved.
Privacy Statement / Site Map / Home / Purchase / Support