Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/s-ol/jsshuffle
A library to just-in-time randomly obfuscate JS.
https://github.com/s-ol/jsshuffle
Last synced: about 1 month ago
JSON representation
A library to just-in-time randomly obfuscate JS.
- Host: GitHub
- URL: https://github.com/s-ol/jsshuffle
- Owner: s-ol
- License: mit
- Created: 2014-08-19T15:09:55.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-08-25T07:51:57.000Z (about 10 years ago)
- Last Synced: 2023-06-07T10:55:14.721Z (over 1 year ago)
- Language: Ruby
- Size: 223 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
jsshuffle ![Gem Version](https://badge.fury.io/rb/jsshuffle.svg)
================================================================A library to just-in-time randomly obfuscate JS.
Installation
------------$ gem install jsshuffle
and
require 'jsshuffle'
should be enough to get you up and running.
For rails, just add _jsshuffle_ to your Gemfile:
gem 'jsshuffle', group: :production
Usage
-----_jsshuffle_ can be used standalone and as a Ruby library.
The standalone executable takes a filename as a parameter or reads the input from `STDIN` and outputs on `STDOUT`:
$ jsshuffle < var test = 13;
> test = (test + 13) * 7;
> alert( test );
> EOF
var dqkwxnvj = 13;
dqkwxnvj = (dqkwxnvj + 13) * 7;
alert(dqkwxnvj);To use _jsshuffle_ in your own Ruby project, instantiate `JsShuffle::Shuffler`:
require 'jsshuffle'
shuffler = JsShuffle::Shuffler.new use: :variable_renaming
puts shuffler.shuffle js: %Q(
var variable = "variable";
function newFunc( parameter ) {
return parameter + " is a cool parameter.";
}console.log( newFunc( variable ) );
)Extending JsShuffle
-------------------You can sublcass `JsShuffle::Methods::Method` and pass the new class as a `use:` argument to `Shuffler#new` or alternatively pass a Block or Proc.
For more information view the RDoc.