Skip to content
This repository has been archived by the owner on May 25, 2020. It is now read-only.

Latest commit

 

History

History
92 lines (58 loc) · 1.56 KB

docs.md

File metadata and controls

92 lines (58 loc) · 1.56 KB

Obfuscator Documentation

obfuscator(options, cb)

Parameters

  • options Object The options
  • cb Function Callback: function (err, obfuscated)

Obfuscate and concatenate a NodeJS "package" because corporate says so.

obfuscator.options(files, root, entry, [strings])

Parameters

  • files Array The files contained in the package
  • root String The root of the package
  • entry String The entry point
  • [strings] Boolean Shall strings be obfuscated

Returns

Object

Create an options object for the obfuscator

Aliases (for back-compat):

  • Options
  • ObfuscatorOptions

Examples:

var opts = new obfuscator.Options(
  // files
  [ './myfile.js', './mydir/thing.js'],
  // root
  './',
  // entry
  'myfile.js',
  // strings
  true)

var opts = obfuscator.options({...})

obfuscator.utils.hex(str)

Parameters

  • str String

Returns

String

Convert (or obfuscate) a string to its escaped hexidecimal representation. For example, hex('a') will return '\x63'.

obfuscator.utils.strings(js)

Parameters

  • js String

Returns

String

Mangle simple strings contained in some js

Strings will be mangled by replacing each contained character with its escaped hexidecimal representation. For example, "a" will render to "\x63".

Strings which contain non-alphanumeric characters other than .-_/ will be ignored.

Strings not wrapped in double quotes will be ignored.

Example:

utils.strings('var foo = "foo"';);
//=> 'var foo = "\x66\x6f\x6f";'