Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

js-fox

1.0.0 • Public • Published

js-fox

JavaScript Obfuscator via js-fox jsfoxguard.com.


Command-line tool:

npm install -g js-fox
echo 'var a="test";' | jsfox
var _9g=['\x74\x65\x73\x74'];var a=_9g[0];

npm package:

npm install js-fox --save
var jsFox = require('js-obfuscator');
jsFox (<string> jsSourceCode [, <object> options ] )
Returns: a Q promise.

Grunt

npm install js-fox --save-dev
grunt.loadNpmTasks('js-fox');

Options (bold values are default)

  • stringsEncoding: [escape-chars-x | null]
  • replaceProperties: [true | false]
  • detachStrings: [true | false]
  • compact: [true | false]
  • concurrency: 2 | Range 1 - 99

Command Help

jsfox -h
Usage: jsfox [OPTIONS] [FILES]

Obfuscate JavaScript files via jsfoxguard.com
Read from STDIN if no files specified.

Default Options:
  -o stringsEncoding=[escape-chars-x|false]
  -o replaceProperties=true
  -o detachStrings=true

Examples

Grunt

 
grunt.loadNpmTasks('js-fox');
 
grunt.initConfig({
  clean: {
    output: 'test/output'
  },
  jsfox: {
    test: {
      options: {
        concurrency: 2,
        stringsEncoding: 'escape-chars-x',
        replaceProperties: true,
        detachStrings: true,
        compact: true
      },
      files: {
        'test/output/test.js': [
          'test/testfile.js',
          'test/bind.js',
          'test/reduce.js'
        ]
      }
    }
  }
});

Node

var jsFox = require('js-fox');
 
var script = 'var a="test";';
 
jsFox(script, {
  compact: false
}).then(function(obfuscated) {
  console.log(obfuscated);
}, function(err) {
  console.error(err);
});
 
/*
var _9j = ['\x74\x65\x73\x74'];
var a = _9j[0];
*/

install

npm i js-fox

Downloadsweekly downloads

6

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar