Footprint
Working with ES6, Babel/Babelify, Browserify? This is for you!
- Node module for reorganizing redundant code. Each Transform is just a method that takes in a text string and can be used by itself.
- Wrote this so I can be at peace migrating to ES6 early and using Browserify and because being bloated bugs me cough jQuery.
- Minimizes the footprint on Babel concatinated files like a Browserify bundle.
- Works on minified (minified with uglify) and non-minified code against any style formatting! (the output is kept in original form for debuggin purposes so even though it will rip against uglified code, you will need to re-uglify after which uglifying should always be done last in the build process anyway)
Development
Requirements
- nodejs
- npm install -g gulp
- npm install
Test
gulp test
Usage
Installation
npm install chickendinosaur-footprint
How to use...
Transform types
- footprint.Transform.usestrict
- footprint.Transform.babel (uses footprint.Transform.usestrict)
Using the transformer in debug
var footprint = ; footprint ;
Using a transform as standalone
var footprint = ;var fs = ; var text = fs; var output = footprintTransform;
Chaining Transforms
var footprint = ; footprint
Chaining multiple input/outputs
var footprint = ; footprint;
Example
Using the footprint.Transform.usestrict Transform
var footprint = ; gulp;
Before
'use strict' "use strict" 'use strict'; "use strict";
After
"use strict";
Results
Input:
- ./test/mock/usestrictMock.dirty.js
- 0.0560 KB
Transform:
- usestrict
Difference:
- 0.0430 KB
- 76.7857 %
Output:
- ./dist/usestrictMock.transformed.js
- 0.0130 KB
Release Notes
v0.1.6
- Added consolidatoin for require/_interopRequireDefault statements.
- Changed all output to original form instead of uglified version since you will have to uglify after anyway.