<commit_before>koa-browserify
------------

middleware for ```koa.js``` that compile CommonJS modules

## install
    
    npm i koa-browserify

## example

```js
var app = require('koa')(),
    browserify = require('koa-browserify');

app.use(browserify({
    root: './public', // root folder for js files
    debug: true // show sorcemap
}));

app.use(cjs('./public')) // equivalent to {root: './public'}

app.listen(3000);
```

## options

* ```root``` root folder for scripts
* ```debug``` enable soucemaps
* ```production``` enable production mode. In production soucemaps not working and code is minified
* ```transform``` you can transform original souce with this option

this code will compile ```jsx``` files to ```js``` code

```js
var browserify = require('koa-browserify'),
    reactify = require('reactify');

app.use(browserify({
    root: './public',
    transform: reactify,
}));

## production

You can use this module in production by setting option ```production``` or ```env``` variable ```NODE_ENV``` to ```production```

```js
app.use(browserify({<commit_msg>fixed doc<commit_after>koa-browserify
------------

middleware for ```koa.js``` that compile CommonJS modules

## install
    
    npm i koa-browserify

## example

```js
var app = require('koa')(),
    browserify = require('koa-browserify');

app.use(browserify({
    root: './public', // root folder for js files
    debug: true // show sorcemap
}));

app.use(cjs('./public')) // equivalent to {root: './public'}

app.listen(3000);
```

## options

* ```root``` root folder for scripts
* ```debug``` enable soucemaps
* ```production``` enable production mode. In production soucemaps not working and code is minified
* ```transform``` you can transform original souce with this option. This options should be a function, that will be called with tr(file) and it should return a through-stream that takes the raw file contents and produces the transformed source.

this code will compile ```jsx``` files to ```js``` code

```js
var browserify = require('koa-browserify'),
    reactify = require('reactify');

app.use(browserify({
    root: './public',
    transform: reactify,
}));
```

## production

You can use this module in production by setting option ```production``` or ```env``` variable ```NODE_ENV``` to ```production```

```js
app.use(browserify({
{'fraction_non_alphanumeric': 0.17292912040990607, 'fraction_numerical': 0.0034158838599487617, 'mean_word_length': 4.12691466083151, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '35413', 'n_tokens_mistral': 708, 'n_tokens_neox': 692, 'n_words': 245}