Socket
Socket
Sign inDemoInstall

parcel-packager-obfuscator

Package Overview
Dependencies
1
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    parcel-packager-obfuscator

Uses javascript-obfuscator to obfuscate entry files


Version published
Weekly downloads
2
decreased by-60%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

parcel-plugin-obfuscate npm Libraries.io dependency status for GitHub repo

This plugin allows you to obfuscate entry javascript files using javascript-obfuscator.

Getting Started

To get started using your favourite package manager.

Install using yarn

yarn add -D parcel-plugin-obfuscate

Install using npm

npm install -D parcel-plugin-obfuscate

Run parcel in production mode to obfuscate code

Using Yarn

yarn cross-env NODE_ENV=production parcel build ./index.js

Using npm

npx cross-env NODE_ENV=production parcel build ./index.js

This runs cross-env which sets NODE_ENV to production which enables this plugin in parcel and later obfuscates the compiled code.

Example

from this:

// original
class Something {
    constructor(){
        this.type = "js";
    }
}

to this:

// obfuscated
var _0x53ed=['type'];(function(_0x5de549,_0xe388a2){var _0x3bfb0e=function(_0x284f19){while(--_0x284f19){_0x5de549['push'](_0x5de549['shift']());}};_0x3bfb0e(++_0xe388a2);}(_0x53ed,0x13f));var _0x168c=function(_0x3efb93,_0x362405){_0x3efb93=_0x3efb93-0x0;var _0x4682eb=_0x53ed[_0x3efb93];return _0x4682eb;};class Something{constructor(){this[_0x168c('0x0')]='js';}}

Tests

This plugin has basic test to ensure that everything works as expected. You can find these tests under test or run them using the test script.

test using yarn

yarn test

test using npm

npm run test

Keywords

FAQs

Last updated on 05 Jul 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc