mirror of
https://github.com/luzhisheng/js_reverse.git
synced 2025-04-23 03:09:21 +08:00
23 lines
420 B
JavaScript
23 lines
420 B
JavaScript
const code = `
|
|
let string = 'hello'
|
|
const count = 5
|
|
for (let i = 0; i < 5; i ++) {
|
|
console.log('i', string[i])
|
|
}
|
|
`
|
|
|
|
const options = {
|
|
// compact: false,
|
|
// controlFlowFlattening: true,
|
|
unicodeEscapeSequence: true
|
|
|
|
}
|
|
|
|
const obfuscator = require('javascript-obfuscator')
|
|
|
|
function obfuscate(code, options) {
|
|
return obfuscator.obfuscate(code, options).getObfuscatedCode()
|
|
}
|
|
|
|
console.log(obfuscate(code, options))
|