
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
obfuscator-loader
Advanced tools
A webpack loader for obfuscating single modules using javascript-obfuscator
This is a module loader for webpack wich obfuscate module source code using javascript-obfuscator.
npm install --save-dev obfuscator-loader
stringArray
option is now available. Thank you Timofey Kachalov.
Obfuscating code can results in quite large files. It's a good idea to obfuscate only your code leaving third party libraries unobfuscated. This is simple to achieve using a plugin if you plan to split your code and third party code in different bundles. Take a look at this plugin.
Sometimes you need to output a single js bundle but you still need to obfuscate the source code of some particular module. In these cases a loader can do the trick.
For example I happened to had to bundle a big third party library (not a module of any sort, I had to use script-loader) in one of my project and I was requested to obfuscate my code.
Define a rule in your webpack config and use the obfuscator-loader as the last of your loaders for your modules. You can add the enforce: 'post' flag to ensure the loader will be called after normal loaders:
module.exports = {
module: {
rules: [
{
test: /\.js$/,
include: [ path.resolve(__dirname, "justMySources") ],
enforce: 'post',
use: { loader: 'obfuscator-loader', options: {/* options here */} }
},
]
}
};
This loader accepts the same options object of javascript-obfuscator
MIT License
Copyright (c) 2018 Valerio Bianchi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
FAQs
A webpack loader for obfuscating single modules using javascript-obfuscator
The npm package obfuscator-loader receives a total of 200 weekly downloads. As such, obfuscator-loader popularity was classified as not popular.
We found that obfuscator-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.