JS-Confuser exposes a simple API that allows you to obfuscate your code with just a few lines of code.
The provided code example will obfuscate the file input.js and write the output to a file named output.js.
Example
Obfuscates source code. Returns a Promise that resolves to an object of the obfuscated result.
Parameter | Type | Description |
---|---|---|
sourceCode | string | The JavaScript code to be obfuscated. |
options | object | The obfuscator settings. |
Return Type: Promise<ObfuscationResult>
Property | Type | Description |
---|---|---|
code | string | The obfuscated code. |
Obfuscates a Babel AST. Returns a Promise.
Note: Mutates the object.
Parameter | Type | Description |
---|---|---|
AST | object | The Babel AST. This object will be mutated. |
options | object | The obfuscator settings. |
The internal object where JS-Confuser presets are stored. The presets ("low", "medium", and "high") can be accessed through: JSConfuser.presets["high"]