dev.ts 808 B

1234567891011121314151617181920212223242526
  1. 'use strict';
  2. import { IdentifierNamesGenerator } from '../../src/enums/generators/identifier-names-generators/IdentifierNamesGenerator';
  3. (function () {
  4. const JavaScriptObfuscator: any = require('../../index');
  5. let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
  6. `
  7. // Paste your JavaScript code here
  8. function hi() {
  9. console.log("Hello World!");
  10. }
  11. hi();
  12. `,
  13. {
  14. compact: false,
  15. renameGlobals: true,
  16. identifierNamesGenerator: IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,
  17. stringArray: true,
  18. rotateStringArray: false
  19. }
  20. ).getObfuscatedCode();
  21. console.log(obfuscatedCode);
  22. console.log(eval(obfuscatedCode));
  23. })();