<commit_before>unreachable-branch
==================

Comments out unreachable code branches in `if` statements, ternaries `?`, and logical operations `||` `&&`, where the test is determinable (like comparing two constants). This is similar to what [UglifyJS](https://github.com/mishoo/UglifyJS2)'s "dead_code" compressor option does, but without the extra code transformations. Unlike UglifyJS, instead of removing the "dead code", it is wrapped in a comment `/* ... */`. This enables further transformations and easy debugging (since you can still see the code that was unreachable).

When combined with something like [envify](https://github.com/hughsk/envify) and [browserify](https://github.com/substack/node-browserify), you can perform conditional `require` calls without including more code than you need.

#### Example outputs #####

```js
// original 
var transport = process.env.TARGET === 'client' ? require('ajax') : require('fs');

// after envify and unreachable-branch
var transport = 'server' === 'client' ? null /*require('ajax')*/ : require('fs');
```

```js
// original
if (process.env.NODE_ENV === 'development') {
  console.log('in dev mode');<commit_msg>Added install instructions to README<commit_after>unreachable-branch
==================

Comments out unreachable code branches in `if` statements, ternaries `?`, and logical operations `||` `&&`, where the test is determinable (like comparing two constants). This is similar to what [UglifyJS](https://github.com/mishoo/UglifyJS2)'s "dead_code" compressor option does, but without the extra code transformations. Unlike UglifyJS, instead of removing the "dead code", it is wrapped in a comment `/* ... */`. This enables further transformations and easy debugging (since you can still see the code that was unreachable).

When combined with something like [envify](https://github.com/hughsk/envify) and [browserify](https://github.com/substack/node-browserify), you can perform conditional `require` calls without including more code than you need.

#### Install ####

```bash
npm install unreachable-branch
```

#### Example outputs #####

```js
// original 
var transport = process.env.TARGET === 'client' ? require('ajax') : require('fs');

// after envify and unreachable-branch
var transport = 'server' === 'client' ? null /*require('ajax')*/ : require('fs');
```

```js
// original
if (process.env.NODE_ENV === 'development') {
  console.log('in dev mode');
{'fraction_non_alphanumeric': 0.15450819672131147, 'fraction_numerical': 0.000819672131147541, 'mean_word_length': 5.133165829145729, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5227600', 'n_tokens_mistral': 677, 'n_tokens_neox': 651, 'n_words': 246}