dev.ts 679 B

123456789101112131415161718192021222324
  1. 'use strict';
  2. import { NO_ADDITIONAL_NODES_PRESET } from '../../src/options/presets/NoCustomNodes';
  3. (function () {
  4. const JavaScriptObfuscator: any = require('../../index');
  5. let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
  6. `
  7. const sdasdas = '123';
  8. `,
  9. {
  10. ...NO_ADDITIONAL_NODES_PRESET,
  11. compact: false,
  12. identifierNamesGenerator: 'dictionary',
  13. identifiersDictionary: ['a', 'b', 'c', 'd', 'e'],
  14. stringArray: true,
  15. stringArrayThreshold: 1
  16. }
  17. ).getObfuscatedCode();
  18. console.log(obfuscatedCode);
  19. console.log(eval(obfuscatedCode));
  20. })();