Giter Club home page Giter Club logo

jeffuscator's Introduction

Build Status Coverage Status License NPM Version

Jeffuscator

Obfuscate JavaScript by renaming all variables and methods to different variations of 'Jeff'. Inspired by this tweet from Evil Elon Musk.

Example

Before:

var firstNum = 1;
var secondNum = 2;

var added = add(firstNum, secondNum);

function add(a, b)
{
    return a + b;
}

After:

var jeff = 1;
var jeffrey = 2;

var jefferey = jeffeory(jeff, jeffrey);

function jeffeory(jeffy, jefrey)
{
    return jeffy + jefrey;
}

Installation

Install Jeffuscator with NPM:

npm install jeffuscator

If you're only interested in the CLI functionality, you may wish to install globally.

Usage

You can import Jeffuscator into your project with:

var Jeffuscator = require('jeffuscator');

To Jeffuscate code, instantiate a new instance of the class with an input, then call the processFiles method. processFiles optionally accepts an output path.

new Jeffuscator('path/to/my/files')
    .processFiles('path/to/output/folder')

The input argument can be either a folder or a file. If passed a folder, it will process every .js file in that folder.

The output path should always be a folder. Processed files will be saved to the output folder, retaining the same structure as the input folder.

CLI Usage

Once installed, you should be able to use Jeffuscator from the command line using the jeffuscate command:

jeffuscate -i path/to/my/input -o path/to/my/output

Under the Hood

Jeffuscator makes use of a custom fork of UglifyJs v1 that switches out the normal string of characters used for obfuscation, with an array of different variations of the name Jeff.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.