Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-contrib-obfuscator

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-contrib-obfuscator

Grunt plugin that obfuscates your JavaScript using the javascript-obfuscator library.

  • 2.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

grunt-contrib-obfuscator Build Status

Obfuscate JavaScript files using javascript-obfuscator@0.8.1.

You can try the javascript-obfuscator module and see all its options here: https://javascriptobfuscator.herokuapp.com

Getting Started

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-contrib-obfuscator --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-contrib-obfuscator');

Obfuscator task

Run this task with the grunt obfuscator command.

Task targets, files and options may be specified according to the grunt Configuring tasks guide.

Options

See the options on the obfuscator repo.

Note that at this time the sourceMap isn't implemented in this plugin.

In addition the the obfuscator options, you can also use:

banner

Type: String Default: ''

This string will be prepended to the obfuscated output. Template strings (e.g. <%= config.value %> will be expanded automatically.

Usage examples

Default options

This configuration will obfuscate the input files using the default options.

obfuscator: {
    options: {
        // global options for the obfuscator
    },
    task1: {
        options: {
            // options for each sub task
        },
        files: {
            'dest/output.js': [
                'src/js/file1.js',
                'src/js/file2.js'
            ]
        }
    }
}
Debug protection and banner

Here you code will be protected against debugging and locked to the domain www.example.com.

obfuscator: {
    options: {
        banner: '// obfuscated with grunt-contrib-obfuscator.\n',
        debugProtection: true,
        debugProtectionInterval: true,
        domainLock: ['www.example.com']
    },
    task1: {
        options: {
            // options for each sub task
        },
        files: {
            'dest/output.js': [
                'src/js/file1.js',
                'src/js/file2.js'
            ]
        }
    }
}

Keywords

FAQs

Package last updated on 19 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc