Skip to content

Instantly share code, notes, and snippets.

@JoeThunyathep
Created March 6, 2022 20:56
Show Gist options
  • Save JoeThunyathep/911cc957e5559b00519faa86bf173d42 to your computer and use it in GitHub Desktop.
Save JoeThunyathep/911cc957e5559b00519faa86bf173d42 to your computer and use it in GitHub Desktop.
var JSObfuscator = require('javascript-obfuscator');
var script_string = `
var a = 1
var b = 2
function plus(a,b) {
return a+b;
}
console.log(plus(a,b))
`
// Obfuscated Script
var script_obfuscated = JSObfuscator.obfuscate(script_string)
console.log(script_obfuscated.getObfuscatedCode());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment