Skip to content

Commit 6bd872c

Browse files
committed
Added base web version
1 parent 2be1bf9 commit 6bd872c

22 files changed

+290
-85
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
Change Log
22
===
3+
v0.17.0
4+
---
5+
* **Web version**: Added web version dist
6+
* Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/247
7+
38
v0.16.0
49
---
510
* Correct obfuscation of object rest and spread properties

README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
Author: Timofey Kachalov
55
-->
66

7-
# JavaScript obfuscator for Node.js
7+
# JavaScript obfuscator
88

99
![logo](https://raw.githubusercontent.com/javascript-obfuscator/javascript-obfuscator/master/images/logo.png)
1010

11-
JavaScript obfuscator is a powerful free obfuscator for JavaScript and Node.js with a wide number of features which provides protection for your source code.
11+
JavaScript obfuscator is a powerful free obfuscator for JavaScript with a wide number of features which provides protection for your source code.
1212

1313
Example of obfuscated code: [gist.github.com](https://gist.github.com/sanex3339/ffc2876123b52e6d11ce45369fd53acf)
1414

@@ -50,7 +50,9 @@ It is not recommended to obfuscate vendor scripts and polyfills, since the obfus
5050

5151
## Installation
5252

53-
Install the package with Yarn or NPM and add it to your `devDependencies`:
53+
#### Using Yarn or NPM
54+
55+
Install the package with Yarn or NPM and add it to your `dependencies` or `devDependencies`:
5456

5557
```sh
5658
$ yarn add --dev javascript-obfuscator
@@ -60,9 +62,21 @@ or
6062
$ npm install --save-dev javascript-obfuscator
6163
```
6264

63-
## Node.js usage
65+
#### In a Browser
66+
67+
Add `<script>` tag with package:
68+
69+
```html
70+
<script src="./node_modules/javascript-obfuscator/dist/index.web.js">
71+
```
72+
73+
or require package from CDN:
74+
75+
```html
76+
TODO
77+
```
6478
65-
Here's an example of how to use it:
79+
## Usage
6680
6781
```javascript
6882
var JavaScriptObfuscator = require('javascript-obfuscator');
@@ -866,7 +880,7 @@ Try to run `npm link javascript-obfuscator` command or install it globally with
866880
### Error `maximum call stack size exceeded`
867881
Likely this is `selfDefending` mechanism. Something is changing source code after obfuscation with `selfDefending` option.
868882
869-
### Web version?
883+
### Online version?
870884
871885
[obfuscator.io](https://obfuscator.io)
872886

bin/javascript-obfuscator

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env node
22

3-
require('../dist/index').runCLI(process.argv);
3+
require('../dist/index.cli').obfuscate(process.argv);

dist/index.cli.js

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.web.js

Lines changed: 54 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.cli.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"use strict";
2+
3+
import { JavaScriptObfuscatorCLI } from './src/JavaScriptObfuscatorCLIFacade';
4+
5+
module.exports = JavaScriptObfuscatorCLI;

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
"mkdirp": "0.5.1",
3434
"multimatch": "2.1.0",
3535
"opencollective": "1.0.3",
36-
"pjson": "1.0.9",
3736
"reflect-metadata": "0.1.12",
3837
"source-map-support": "0.5.4",
3938
"string-template": "1.0.0",
@@ -64,6 +63,7 @@
6463
"coveralls": "3.0.0",
6564
"istanbul": "1.1.0-alpha.1",
6665
"mocha": "5.1.0",
66+
"pjson": "1.0.9",
6767
"pre-commit": "1.2.2",
6868
"rimraf": "2.6.2",
6969
"sinon": "4.5.0",
@@ -85,7 +85,8 @@
8585
},
8686
"scripts": {
8787
"start": "scripts/start",
88-
"webpack": "scripts/webpack",
88+
"webpack:prod": "scripts/webpack-prod",
89+
"webpack:dev": "scripts/webpack-dev",
8990
"build": "scripts/build",
9091
"watch": "scripts/watch",
9192
"removeCacheDir": "scripts/remove-cache-dir",

scripts/build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

33
yarn run removeCacheDir &&
4-
yarn run webpack &&
4+
yarn run webpack:prod &&
55
yarn run tslint &&
66
yarn test

scripts/watch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
$(yarn bin)/webpack --mode development --watch
3+
$(yarn bin)/webpack --config webpack/webpack.config.js --mode development --watch

0 commit comments

Comments
 (0)