npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

decent-messup

v1.0.8

Published

Mess up js in a different way.

Downloads

3

Readme

Decent Mess Up

Want to understand my js? No way!

Demo

Playground

Input:


const str="abc";
function func(){
    const obj={};
    obj.property={
        key1:'value1',
        'key2':str,
        ['key'+3]:'value3'
    }
    console.log(obj);    
}
func();

Output:

const _a = 'vcb3aotkleyr21ugp';
const _b = 'bcktuovea2grp1y3l';
const _c = 'yecauop3rkbltg2v1';
const str = _a[4] + _b[0] + _a[1];
function func() {
    const _a2 = _b;
    const _b2 = _a;
    const _c2 = _c;

    const obj = {};
    obj[_a2[12] + _c2[8] + _c2[5] + _a2[12] + _b2[9] + _c2[8] + _b2[6] + _a2[14]] = {
        [_b2[7] + _b2[9] + _a2[14] + _b2[13]]: _c2[15] + _c2[3] + _a2[16] + _b2[14] + _c2[1] + _a2[13],
        [_a2[2] + _c2[1] + _b2[10] + _a2[9]]: str,
        [_c2[9] + _a2[7] + _a2[14] + 3]: _c2[15] + _c2[3] + _c2[11] + _b2[14] + _a2[7] + _a2[15]
    };
    console[_a2[16] + _c2[5] + _b2[15]](obj);
}
func();

Install

npm i -D decent-messup

Usage

Use it before babel and uglifying. Using it with uglifier is highly recommended.

const messup=require('decent-messup');
messup(yourcode[,options]);

Use with Webpack

module: {
    loaders: [{
        test: /\.jsx?$/,
        loader: 'decent-messup/loader',
        query: {
            headCnt:5,
            es6:true
        },
        },{
        test: /\.jsx?$/,
        loader: 'babel-loader',
        query: {
            presets: ['latest', 'stage-0'],
            plugins: []
        },
        }]
},

Use with Gulp

const transform = require('gulp-transform');
const messup = require('decent-messup');
gulp.task('quadruple', function() {
  return gulp.src('src/*.js')
    .pipe(transform(code => messup(code,{headCnt:5,es6:true})))
    .pipe(gulp.dest('dist'));
});

Options

The default options are:

{
    headCnt: 3,
    es6:false
}

headCnt

The count of string variables in each function scope.

headCnt=1:

var _a = '31olg2';
console[_a[3] + _a[2] + _a[4]](_a[1] + _a[5] + _a[0]);

headCnt=3:

var _a = 'l1go23';
var _b = '13gol2';
var _c = '23og1l';
console[_b[4] + _b[3] + _b[2]](_b[0] + _b[5] + _b[1]);

es6

Indicates if it should output es6 code.

Input:

a={b:'c'}

es6=false:

var _a = 'c';
var _b = 'c';
var _c = 'c';
a = { b: _c[0] };

es6=true:

const _a = 'cb';
const _b = 'bc';
const _c = 'bc';
a = { [_b[0]]: _b[1] };