# gulp-trim-fn

> gulp-trim-fn

Latest version **1.1.6** (published 2016-04-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install gulp-trim-fn
pnpm add gulp-trim-fn
yarn add gulp-trim-fn
bun add gulp-trim-fn
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.6 |
| Published | 2016-04-14 |
| First published | 2016-04-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Ruslan Prytula |
| Maintainers | rsqw |
| Keywords | gulp-trim-fn |

## Links

- npm: https://www.npmjs.com/package/gulp-trim-fn
- Repository: https://github.com/milworm/gulp-trim-fn
- Homepage: http://milworm.github.io/gulp-trim-fn
- Issues: https://github.com/milworm/gulp-trim-fn/issues
- npm.io page: https://npm.io/package/gulp-trim-fn

## Dependencies (5)

- [vinyl](https://npm.io/package/vinyl.md) ^1.1.1
- [esprima](https://npm.io/package/esprima.md) ^2.7.1
- [through2](https://npm.io/package/through2.md) ^2.0.0
- [escodegen](https://npm.io/package/escodegen.md) ^1.8.0
- [estraverse](https://npm.io/package/estraverse.md) ^4.1.1

## Recent versions

- 1.1.6 (latest) — 2016-04-14
- 1.1.5 — 2016-04-14
- 1.1.4 — 2016-04-14
- 1.1.3 — 2016-04-14
- 1.1.2 — 2016-04-14
- 1.1.1 — 2016-04-14
- 1.1.0 — 2016-04-14
- 1.0.0 — 2016-04-14

## README

## 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](https://supporterhq.com/api/b/399936c021d5111d90001de85283a4b5/gulp-trim-fn)](https://supporterhq.com/support/399936c021d5111d90001de85283a4b5/gulp-trim-fn)

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

### Usage
```javascript
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:
```javascript
function SideBar() {}
SideBar.prototype = {
  render: function() {
    var data = this._getRenderData();
    document.body.innerHTML = this._getTpl().apply(data);
  },
  _getTpl: function() {},
  _getRenderData: function() {},
  _getElement: function() {}
}
```

After:
```javascript
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).

---
_Source: https://npm.io/package/gulp-trim-fn · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
