om
obfuscator-middleware
npm i obfuscator-middleware
om

obfuscator-middleware

(NodeJS) Obfuscate and serve your JS files with a middleware

by Liam

1.0.4 (see all)License:MITTypeScript:Not FoundCategories:Express Obfuscation
npm i obfuscator-middleware
Readme

Obfuscator Middleware NPM Version node JavaScript Style Guide

The way this middleware works is it's an express middleware for serving minified obfuscated Javascript files. You can serve it at a certain path and method.

Methods

The object obtained from requiring is the init function which will return the middleware.

  • obf(options) (this will return a middleware of req, res, next)
  • options: {store, location, param}

The default options are options: {require('store'), './', 'fileName'}

The param option refers to what parameter we are looking for i.e :fileName is the correct way to work with the default options.

Example

const obf = require("./obfuscator");
app.get('/scripts/:fileName.js', obf({location: './assets/scripts/'}));

In this example, anything requesting GET from /scripts/*.js will be found from ./assets/scripts/ and served obfuscated.

Before

console.log("Hello World");

After

var _0x3bd1=["1FhAdKg","736427PHdfOG","317622WXJmvL","8606ZVtrej","395851sodQMq","71312Afnxvx","427562qIquUR","2hxrSZa","84moaWHU","672326wHdSex","Hello World","log"],_0x2c3f2a=_0x3293;function _0x3293(r,a){return _0x3bd1[r-=319]}(function(a){for(var r=_0x3293;;)try{if(601688===parseInt(r(326))+-parseInt(r(322))+parseInt(r(330))+-parseInt(r(324))*parseInt(r(319))+parseInt(r(325))*parseInt(r(320))+-parseInt(r(323))*parseInt(r(329))+-parseInt(r(321)))break;a.push(a.shift())}catch(r){a.push(a.shift())}})(_0x3bd1),console[_0x2c3f2a(328)](_0x2c3f2a(327));

Downloads/wk

2

GitHub Stars

0

LAST COMMIT

6mos ago

MAINTAINERS

1

CONTRIBUTORS

2

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
1.0.4
latest
1yr ago
No tutorials found
Add a tutorial