obfuscator-middleware

1.0.4 • Public • Published

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.

Package Sidebar

Install

npm i obfuscator-middleware

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

4.29 kB

Total Files

4

Last publish

Collaborators

  • birthdates