Skip to content
This repository was archived by the owner on Oct 31, 2022. It is now read-only.

Commit e1bab49

Browse files
Add description and examples
1 parent 32a96de commit e1bab49

1 file changed

Lines changed: 16 additions & 21 deletions

File tree

README.md

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
[![Build Status](https://travis-ci.org/tomasz-oponowicz/grunt-javascript-obfuscator.svg?branch=master)](https://travis-ci.org/tomasz-oponowicz/grunt-javascript-obfuscator)
44

5-
> Obfuscates JavaScript files.
5+
> Obfuscates JavaScript files using amazing [javascript-obfuscator](https://github.com/javascript-obfuscator/javascript-obfuscator).
66
77
## Getting Started
88
This plugin requires Grunt `~0.4.5`
99

10-
If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
10+
If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin and _javascript-obfuscator_ with this command:
1111

1212
```shell
1313
npm install grunt-javascript-obfuscator javascript-obfuscator --save-dev
@@ -39,46 +39,40 @@ grunt.initConfig({
3939

4040
### Options
4141

42-
#### options.separator
43-
Type: `String`
44-
Default value: `', '`
45-
46-
A string value that is used to do something with whatever.
47-
48-
#### options.punctuation
49-
Type: `String`
50-
Default value: `'.'`
51-
52-
A string value that is used to do something else with whatever else.
42+
Options are passed directly to _javascript-obfuscator_. Please visit [documentation of the project](https://github.com/javascript-obfuscator/javascript-obfuscator) for a complete list of options.
5343

5444
### Usage Examples
5545

5646
#### Default Options
57-
In this example, the default options are used to do something with whatever. So if the `testing` file has the content `Testing` and the `123` file had the content `1 2 3`, the generated result would be `Testing, 1 2 3.`
47+
48+
In this example, the default options are used to obfuscate scripts:
5849

5950
```js
6051
grunt.initConfig({
6152
javascript_obfuscator: {
62-
options: {},
53+
options: {
54+
/* Default options */
55+
},
6356
files: {
64-
'dest/default_options': ['src/testing', 'src/123'],
57+
'dist/obfuscated.js': ['src/module1.js', 'src/module2.js']
6558
},
6659
},
6760
});
6861
```
6962

7063
#### Custom Options
71-
In this example, custom options are used to do something else with whatever else. So if the `testing` file has the content `Testing` and the `123` file had the content `1 2 3`, the generated result in this case would be `Testing: 1 2 3 !!!`
64+
65+
In this example, custom options are used to obfuscate scripts. `debugProtection` makes it almost impossible to use the console tab of the Developer Tools:
7266

7367
```js
7468
grunt.initConfig({
7569
javascript_obfuscator: {
7670
options: {
77-
separator: ': ',
78-
punctuation: ' !!!',
71+
debugProtection: true,
72+
debugProtectionInterval: true
7973
},
8074
files: {
81-
'dest/default_options': ['src/testing', 'src/123'],
75+
'dist/obfuscated.js': ['src/module1.js', 'src/module2.js']
8276
},
8377
},
8478
});
@@ -88,4 +82,5 @@ grunt.initConfig({
8882
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).
8983

9084
## Release History
91-
_(Nothing yet)_
85+
86+
* 2016-11-08   v1.0.0   First release.

0 commit comments

Comments
 (0)