0.2.1 • Published 9 years ago

strmin v0.2.1

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

Strmin

A simple tool for compressing JavaScript string.

Main

dist/
├── strmin.js      (6 KB)
└── strmin.min.js  (3 KB)

Getting started

Quick start

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.