UglifyJS/README.md

34 lines
1.4 KiB
Markdown
Raw Normal View History

2015-01-22 15:47:11 +00:00
UnglifyJS
2012-10-03 09:22:59 +00:00
==========
2015-01-22 15:47:11 +00:00
UnglifyJS is a JavaScript tool that renames variables and parameters to names based on statistical model learnt from thousands of open source projects.
This is on open-source reimplementation of the [JS Nice](http://www.jsnice.org) tool which provides similar functionality.
2012-10-03 09:22:59 +00:00
2015-01-22 15:47:11 +00:00
The implementation of UnglifyJS is based on [UglifyJS 2](https://github.com/mishoo/UglifyJS2) -- parser, minifier, compressor or beautifier toolkit for JavaScript.
2012-10-03 09:22:59 +00:00
2015-01-22 15:47:11 +00:00
This page documents how to use the UnglifyJS as a client of the [Nice 2 Predict](https://github.com/eth-srl/2Nice) framework to build statistical model learnt from thousands of open source projects, which is subsequently used to rename variables and parameters names of minified JavaScript files.
2012-10-03 09:22:59 +00:00
2015-01-22 15:47:11 +00:00
Install UnuglifyJS
-------
2012-10-08 11:30:34 +00:00
2015-01-22 15:47:11 +00:00
First make sure you have installed the latest version of [node.js](http://nodejs.org/) and [NPM](https://www.npmjs.com/). (You may need to restart your computer after this step).
2012-10-08 11:30:34 +00:00
2015-01-22 15:47:11 +00:00
sudo apt-get install nodejs npm
2012-10-08 11:30:34 +00:00
2015-01-22 15:47:11 +00:00
Download UnuglifyJS git repository:
2012-10-08 11:30:34 +00:00
2015-01-22 15:47:11 +00:00
git clone https://github.com/eth-srl/UnuglifyJS.git
Once you downloaded the sources, install all the dependencies using NPM:
2012-10-08 11:30:34 +00:00
2015-01-22 15:47:11 +00:00
sudo npm install
2013-05-01 13:56:20 +00:00
2015-01-22 15:47:11 +00:00
(Optional) Check that everything is installed correctly by running the tests:
2012-10-08 11:30:34 +00:00
2015-01-22 15:47:11 +00:00
./test/run-tests.js
2012-10-08 11:30:34 +00:00
2015-01-22 15:47:11 +00:00
Install Nice 2 Predict
-------
2012-10-08 11:30:34 +00:00
2015-01-22 15:47:11 +00:00
To install Nice 2 Predict framework please follow the instructions on the https://github.com/eth-srl/2Nice page.