Obfuscate JavaScript files via the formal (paid) API of http://javascriptobfuscator.com.
npm install js-obfuscator-apiObfuscate your JS code using the formal (paid) HTTP API of
You need a Premium Membership Subscription in order to use this package.
bash
$ npm i -D js-obfuscator-api
`$3
`js
module.exports = function (grunt) {
require('js-obfuscator-api')(grunt); grunt.initConfig({
obfuscate: {
dist: {
src: 'dist/bundle.js',
dest: 'dist/bundle.js',
obfuscateOptions: {
APIKey: process.env.OBFUSCATOR_API_KEY,
APIPwd: process.env.OBFUSCATOR_API_PWD,
VariableExclusion: '^_get_ ^_set_ ^_mtd_',
EncodeStrings: true,
MoveStrings: true,
ReplaceNames: true,
WriteFormats_KeepIndent: false
}
}
}
});
grunt.registerTask('deploy', ['obfuscate:dist']);
};
`Check out the default options and
read more about obfuscation options at: .
$3
It is NOT recommended to put these hard coded in Gruntfile.js. You should pass them as environment variables using process.env`.