Parcourir la source

remove RawSource

sanex3339 il y a 9 ans
Parent
commit
2346f03175
2 fichiers modifiés avec 13 ajouts et 3 suppressions
  1. 2 3
      index.ts
  2. 11 0
      readme.md

+ 2 - 3
index.ts

@@ -7,8 +7,7 @@ import { UnicodeArrayNodesGroup } from './src/node-groups/UnicodeArrayNodesGroup
 import { Utils } from './src/Utils';
 
 let escodegen = require('escodegen'),
-    esprima = require('esprima'),
-    RawSource: any = require('webpack-core/lib/RawSource');
+    esprima = require('esprima');
 
 export class JavaScriptObfuscator {
     /**
@@ -38,7 +37,7 @@ export class JavaScriptObfuscator {
      * @param astTree
      */
     private static generateCode (astTree: any): string {
-        return new RawSource(escodegen.generate(astTree, JavaScriptObfuscator.escodegenParams));
+        return escodegen.generate(astTree, JavaScriptObfuscator.escodegenParams);
     }
 }
 

+ 11 - 0
readme.md

@@ -1,6 +1,7 @@
 #JavaScript obfuscator for Node.js
 
 JavaScript obfuscator for Node.js and free alternative of [js-obfuscator](https://github.com/caiguanhao/js-obfuscator) without any limits.
+Compatible with ES6.
 
 ###Installation
 
@@ -19,6 +20,16 @@ var obfuscatedCode = JavaScriptObfuscator.obfuscate(
         rotateUnicodeArray: false
     }
 );
+
+console.log(obfuscatedCode);
+/*
+var _0x41c0 = [
+    '\u0061\u0062\u0063',
+    '\u006c\u006f\u0067'
+];
+var variable = _0x41c0[0];
+console[_0x41c0[1]](variable);
+*/
 ```
 
 ## obfuscate(sourceCode, options)