🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →

javascript-obfuscator

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

javascript-obfuscator - npm Package Compare versions

Comparing version

to
0.1.1

{
"name": "javascript-obfuscator",
"version": "0.1.0",
"version": "0.1.1",
"description": "JavaScript obfuscator",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -5,2 +5,3 @@ #JavaScript obfuscator for Node.js

Compatible with ES6.
Tested on Angular2 bundle.

@@ -19,3 +20,8 @@ ###Installation

var obfuscatedCode = JavaScriptObfuscator.obfuscate(
`var variable = 'abc'; console.log(variable);`,
`
(function(){
var variable = 'abc';
console.log(variable);
})();
`,
{

@@ -28,8 +34,10 @@ rotateUnicodeArray: false

/*
var _0x41c0 = [
var _0x8741 = [
'\u0061\u0062\u0063',
'\u006c\u006f\u0067'
];
var variable = _0x41c0[0];
console[_0x41c0[1]](variable);
(function () {
var _0x45e59c = _0x8741[0];
console[_0x8741[1]](_0x45e59c);
}());
*/

@@ -61,3 +69,3 @@ ```

For more hard understanding of code, during each obfuscation all literal values are stored in array as Unicode codes sequence.
This options will rotate all values inside array at random value during obfuscation of code, and insert inside source code helper function
This options will rotate all values inside array on a random value during obfuscation of code, and insert inside source code helper function
which will rotate array values back to their original indexes.

@@ -64,0 +72,0 @@