1.1.6 • Published 8 years ago

gulp-trim-fn v1.1.6

Weekly downloads
1
License
ISC
Repository
github
Last release
8 years ago

Gulp module to trim private methods/properties in JS files.

gulp-trim-fn

Introduction

gulp-trim-fn is a small gulp module that obfuscates private functions/properties (with "_"-prefix in their names) in js files (babel-generated code is supported) in order to protect your code.

Support

Installation

npm install gulp-trim-fn --save-dev

Usage

const gulp = require('gulp');
const trimFn = require('gulp-trim-fn');

gulp.task('trim-fn', () => {
  return gulp.src('./src/**/*.js')
    .pipe(trimFn())
    .pipe(gulp.dest('./lib/'));
});

Example

Before:

function SideBar() {}
SideBar.prototype = {
  render: function() {
    var data = this._getRenderData();
    document.body.innerHTML = this._getTpl().apply(data);
  },
  _getTpl: function() {},
  _getRenderData: function() {},
  _getElement: function() {}
}

After:

function SideBar() {}
SideBar.prototype = {
  render: function() {
    var data = this.a1();
    document.body.innerHTML = this.a2().apply(data);
  },
  a2: function() {},
  a1: function() {},
  a3: function() {}
}

Authors and Contributors

Created in 2016 by Ruslan Prytula (@milworm).

1.1.6

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago