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

confusionjs

v1.0.6

Published

A javaScript Obfuscation middleware library for expressjs built on top of javascript-obfuscation

Downloads

28

Readme

ConfusionJs

ConfusionjS is a javascript obfuscation middleware library for nodejs.

In order to use confusionjs into your nodejs express app, install the module into project like so:

Install using npm:

$ npm install --save confusionjs

Install using Yarn:

$ yarn add confusionjs

Usage

In Node.js Express App:

// Load express
const express = require("express");
// Load Confusionjs
const confuse = require('confusionjs');

const app = express();

let options = {
    root:"./static",
    store:"confused"
    cache:true,
    debug:true,
};

app.use(confuse(options));

Note: Install ConfusionJs for use in the Node.js > 8

Why ConfisionJs?

JavaScript code running in the browser is visible to anybody who wishes to see it. This can sometimes pause a security threat to your application as people with malicious intent can steal or compromise your source code. ConfusionJs limits those threats by obfuscating the javascript code so that it becomes difficult to read or decipher. consider the following script as example:

(function(){
    alert("confuse the enemy!");
})();

In a normal setup, the code will just be delivered as is and anybody will be able to see the code. However, Confusionjs takes the raw code and obfuscates it into a more hard to read and decipher syntax such as the one below:

var _0x4f62 = [
    'FhxUT',
    'btlxw'
];
(function (_0x30ac87, _0x346513) {
    var _0x2f9996 = function (_0x360049) {
        while (--_0x360049) {
            _0x30ac87['push'](_0x30ac87['shift']());
        }
    };
    _0x2f9996(++_0x346513);
}(_0x4f62, 0x18f));
var _0x11b1 = function (_0x11e762, _0x3fac47) {
    _0x11e762 = _0x11e762 - 0x0;
    var _0x58af7a = _0x4f62[_0x11e762];
    return _0x58af7a;
};
(function () {
    var _0x178c8d = {
        'btlxw': function (_0x110a9e, _0x35231c) {
            return _0x110a9e(_0x35231c);
        },
        'FhxUT': 'hit'
    };
    _0x178c8d[_0x11b1('0x0')](alert, _0x178c8d[_0x11b1('0x1')]);
}());

options

The following options are currently accepted when instantiating confusionjs:

  • root : A string. this represents the root of your static or public folder e.g "./static" or "./public"

  • store: A string. a folder where to store the obfuscated javascript files

  • cache: A boolean. determines wether or not confusionjs should create a new confused file everytime a js file is requested

  • debug: A boolean. wether to log to console any debug information e.g when a file is cahed or served from cache

Author

The Author of this library is Lee M. Lwando Other Social Links: Twitter Facebook Email Mobile

Contribution

Feel free to create Pull Requests :smile:

License

Copyright (c) 2018 Lee M. Lwando; Copyright (c) 2018 MicroTech Cloud Solutions;

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.