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

obfuscator-loader

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

obfuscator-loader

A webpack loader for obfuscating single modules using javascript-obfuscator

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
143
increased by4.38%
Maintainers
1
Weekly downloads
 
Created
Source

obfuscator-loader for webpack

This is a module loader for webpack wich obfuscate module source code using javascript-obfuscator.

Installation

npm install --save-dev obfuscator-loader

What's new in 1.1.1

stringArray option is now available. Thank you Timofey Kachalov.

Why not a plugin?

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.

Usage

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 */} }
      },
    ]
  }
};

Options

This loader accepts the same options object of javascript-obfuscator

License

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.

Keywords

FAQs

Package last updated on 31 Mar 2018

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