
Security News
AI Slop Is Polluting Bug Bounty Platforms with Fake Vulnerability Reports
AI-generated slop reports are making bug bounty triage harder, wasting maintainer time, and straining trust in vulnerability disclosure programs.
grunt-contrib-obfuscator
Advanced tools
Grunt plugin that obfuscates your JavaScript using the javascript-obfuscator library.
Obfuscate JavaScript files using javascript-obfuscator@^2.0.0.
You can try the javascript-obfuscator module and see all its options here: https://obfuscator.io/
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
npm install javascript-obfuscator --save-dev
Notice that you should install manually javascript-obfuscator
. This makes it easier to have a newer version of the obfuscator library if needed.
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-contrib-obfuscator');
Run this task with the grunt obfuscator
command.
Task targets, files and options may be specified according to the grunt Configuring tasks guide.
See the options on the obfuscator repo.
Note that at this time the sourceMap
isn't implemented in this plugin.
In addition to the obfuscator options, you can also use:
Type: String
Default: ''
This string will be prepended to the obfuscated output. Template strings (e.g. <%= config.value %>
will be expanded automatically.
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'
]
}
}
}
This configuration will obfuscate the input files in a destination folder by keeping the original names and directories
obfuscator: {
options: {
// global options for the obfuscator
},
task1: {
options: {
// options for each sub task
},
files: {
'dest/': [ // the files and their directories will be created in this folder
'src/js/file1.js',
'src/js/folder/file2.js'
]
}
}
}
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'
]
}
}
}
FAQs
Grunt plugin that obfuscates your JavaScript using the javascript-obfuscator library.
The npm package grunt-contrib-obfuscator receives a total of 1,716 weekly downloads. As such, grunt-contrib-obfuscator popularity was classified as popular.
We found that grunt-contrib-obfuscator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
AI-generated slop reports are making bug bounty triage harder, wasting maintainer time, and straining trust in vulnerability disclosure programs.
Research
Security News
The Socket Research team investigates a malicious Python package disguised as a Discord error logger that executes remote commands and exfiltrates data via a covert C2 channel.
Research
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.