<commit_before># JScrambler Client for Node.js

- [RC config](#rc-config)
- [CLI](#cli)
  - [Required Fields](#required-fields)
  - [Output to a single file](#output-to-a-single-file)
  - [Output multiple files to a directory](#output-multiple-files-to-a-directory)
  - [Using minimatch](#using-minimatch)
  - [Using configuration file](#using-configuration-file)
- [API](#api)
  - [Upload/download example](#uploaddownload-example)
- [JScrambler Options](#jscrambler-options)
  - [asserts_elimination](#asserts_elimination)
  - [browser_os_lock](#browser_os_lock)
  - [constant_folding](#constant_folding)
  - [dead_code](#dead_code)
  - [dead_code_elimination](#dead_code_elimination)
  - [debugging_code_elimination](#debugging_code_elimination)
  - [dictionary_compression](#dictionary_compression)
  - [domain_lock](#domain_lock)
  - [domain_lock_warning_function](#domain_lock_warning_function)
  - [dot_notation_elimination](#dot_notation_elimination)
  - [exceptions_list](#exceptions_list)
  - [expiration_date](#expiration_date)
  - [expiration_date_warning_function](#expiration_date_warning_function)
  - [function_outlining](#function_outlining)
  - [function_reorder](#function_reorder)
  - [ignore_files](#ignore_files)
  - [literal_hooking](#literal_hooking)
  - [duplicate_literals](#duplicate_literals)
  - [member_enumeration](#member_enumeration)
  - [mode](#mode)
  - [name_prefix](#name_prefix)
  - [rename_all](#rename_all)
  - [rename_local](#rename_local)
  - [self_defending](#self_defending)
  - [string_splitting](#string_splitting)
  - [whitespace](#whitespace)

## RC configuration
You may put your access and secret keys into a config file if found in [these directories](https://github.com/dominictarr/rc#standards). Besides simplifying the command entry, this has the added benefit of not logging your JScrambler credentials.

Here's an example of what your `.jscramblerrc` file should look like:

```javascript
{
  "keys": {
    "accessKey": "XXXXXX",
    "secretKey": "XXXXXX"
  },
  "params": {
    "self_defending": "%DEFAULT%"
  }
}
```
Replace the `XXXXXX` fields with your values of course. :)

## CLI
```bash
npm install -g jscrambler
```
    Usage: jscrambler [source files] [options]

    Options:

      --help
      -V, --version
      -c, --config [config]
      -o, --output [output]
      -a, --access-key <accessKey>
      -s, --secret-key <secretKey>
      -h, --host [host]
      -p, --port [port]
      -v, --api-version [apiVersion]
      --asserts-elimination [assertsElimination]
      --browser-os-lock [browserOsLock]
      --constant-folding
      --dead-code
      --dead-code-elimination
      --debugging-code-elimination [debuggingCodeElimination]
      --dictionary-compression
      --domain-lock [domainLock]
      --domain-lock-warning-function [domainLockWarningFunction]
      --dot-notation-elimination
      --exceptions-list [exceptionsList]
      --expiration-date [expirationDate]
      --expiration-date-warning-function [expirationDateWarningFunction]
      --function-outlining
      --function-reorder
      --ignore-files [ignoreFiles]
      --literal-hooking [literalHooking]
      --literal-duplicates
      --member-enumeration
      --mode [mode]
      --name-prefix [namePrefix]
      --rename-all
      --rename-local
      --self-defending
      --string-splitting [stringSplitting]
      --whitespace


### Required Fields
When making API requests you must pass valid secret and access keys, through the command line or by having a `.jscramblerrc` file. These keys are each 40 characters long, alpha numeric strings, and uppercase. You can find them in your jscramber web dashboard under `My Account > Api access`. In the examples these are shortened to `XXXX` for the sake of readability.

### Output to a single file
```bash
jscrambler input.js -a XXXX -s XXXX > output.js
```

### Output multiple files to a directory
```bash
jscrambler input1.js input2.js -o dest/ -a XXXX -s XXXX
```

### Using minimatch
```bash
jscrambler "lib/**/*.js" -o dest/ -a XXXX -s XXXX
```

### Using configuration file
```bash
jscrambler input.js -s XXXX -a XXXX -c ./config.json > output.js
```
where `config.json` is an object optionally containing any of the JScrambler options listed [here](#jscrambler-options).<commit_msg>improve documentation on -c cli arg<commit_after># JScrambler Client for Node.js

- [RC configuration](#rc-configuration)
- [CLI](#cli)
  - [Required Fields](#required-fields)
  - [Output to a single file](#output-to-a-single-file)
  - [Output multiple files to a directory](#output-multiple-files-to-a-directory)
  - [Using minimatch](#using-minimatch)
  - [Using configuration file](#using-configuration-file)
- [API](#api)
  - [Upload/download example](#uploaddownload-example)
- [JScrambler Options](#jscrambler-options)
  - [asserts_elimination](#asserts_elimination)
  - [browser_os_lock](#browser_os_lock)
  - [constant_folding](#constant_folding)
  - [dead_code](#dead_code)
  - [dead_code_elimination](#dead_code_elimination)
  - [debugging_code_elimination](#debugging_code_elimination)
  - [dictionary_compression](#dictionary_compression)
  - [domain_lock](#domain_lock)
  - [domain_lock_warning_function](#domain_lock_warning_function)
  - [dot_notation_elimination](#dot_notation_elimination)
  - [exceptions_list](#exceptions_list)
  - [expiration_date](#expiration_date)
  - [expiration_date_warning_function](#expiration_date_warning_function)
  - [function_outlining](#function_outlining)
  - [function_reorder](#function_reorder)
  - [ignore_files](#ignore_files)
  - [literal_hooking](#literal_hooking)
  - [duplicate_literals](#duplicate_literals)
  - [member_enumeration](#member_enumeration)
  - [mode](#mode)
  - [name_prefix](#name_prefix)
  - [rename_all](#rename_all)
  - [rename_local](#rename_local)
  - [self_defending](#self_defending)
  - [string_splitting](#string_splitting)
  - [whitespace](#whitespace)

## RC configuration
You may put your access and secret keys into a config file if found in [these directories](https://github.com/dominictarr/rc#standards). Besides simplifying the command entry, this has the added benefit of not logging your JScrambler credentials.

Here's an example of what your `.jscramblerrc` file should look like:

```javascript
{
  "keys": {
    "accessKey": "XXXXXX",
    "secretKey": "XXXXXX"
  },
  "params": {
    "self_defending": "%DEFAULT%"
  }
}
```
Replace the `XXXXXX` fields with your values of course. :)

## CLI
```bash
npm install -g jscrambler
```
    Usage: jscrambler [source files] [options]

    Options:

      --help
      -V, --version
      -c, --config [config]
      -o, --output [output]
      -a, --access-key <accessKey>
      -s, --secret-key <secretKey>
      -h, --host [host]
      -p, --port [port]
      -v, --api-version [apiVersion]
      --asserts-elimination [assertsElimination]
      --browser-os-lock [browserOsLock]
      --constant-folding
      --dead-code
      --dead-code-elimination
      --debugging-code-elimination [debuggingCodeElimination]
      --dictionary-compression
      --domain-lock [domainLock]
      --domain-lock-warning-function [domainLockWarningFunction]
      --dot-notation-elimination
      --exceptions-list [exceptionsList]
      --expiration-date [expirationDate]
      --expiration-date-warning-function [expirationDateWarningFunction]
      --function-outlining
      --function-reorder
      --ignore-files [ignoreFiles]
      --literal-hooking [literalHooking]
      --literal-duplicates
      --member-enumeration
      --mode [mode]
      --name-prefix [namePrefix]
      --rename-all
      --rename-local
      --self-defending
      --string-splitting [stringSplitting]
      --whitespace


### Required Fields
When making API requests you must pass valid secret and access keys, through the command line or by having a `.jscramblerrc` file. These keys are each 40 characters long, alpha numeric strings, and uppercase. You can find them in your jscramber web dashboard under `My Account > Api access`. In the examples these are shortened to `XXXX` for the sake of readability.

### Output to a single file
```bash
jscrambler input.js -a XXXX -s XXXX > output.js
```

### Output multiple files to a directory
```bash
jscrambler input1.js input2.js -o dest/ -a XXXX -s XXXX
```

### Using minimatch
```bash
jscrambler "lib/**/*.js" -o dest/ -a XXXX -s XXXX
```

### Using configuration file
```bash
jscrambler input.js -s XXXX -a XXXX -c ./config.json > output.js
```
where `config.json` is an object optionally containing any of the JScrambler options listed [here](#jscrambler-options), using the structure described [in the RC configuration](#rc-config).
{'fraction_non_alphanumeric': 0.13265892631336934, 'fraction_numerical': 0.0009196459363145189, 'mean_word_length': 3.7437295528898584, 'pattern_counts': {'":': 10, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '998479', 'n_tokens_mistral': 2905, 'n_tokens_neox': 2753, 'n_words': 664}