0.2.1 • Published 9 years ago
strmin v0.2.1
Strmin
A simple tool for compressing JavaScript string.
Main
dist/
├── strmin.js (6 KB)
└── strmin.min.js (3 KB)
Getting started
Quick start
- Download the latest release.
- Clone the repository:
git clone https://github.com/fengyuanchen/strmin.git
. - Install with NPM:
npm install strmin
.
Usage
var strmin = new Strmin(options);
strmin.compress(source, function (result) {
console.log(result);
});
Options
escape
- type:
String
- options:
'"'
,"'"
- default:
'"'
Escape the quotation mark.
report
- type:
Boolean
- default:
true
Report the result length on the console.
strict
- type:
Boolean
- default:
true
The result length must be less than the source length. If not, the source will be return as the result.
Methods
setup(options)
Change the default options.
compress(source, callback)
Compress source string.
Browser Support
- Chrome 36+
- Firefox 31+
- Internet Explorer 9+
- Opera 21+
- Safari 5.1+
License
Released under the MIT license.