<commit_before># IC.js

InterCity.js - express.js-based, modular and lightweight NodeJS framework/structure

Main components:
* [Express.js](http://expressjs.com/) (HTTP Server)
* [Nunjucks](http://mozilla.github.io/nunjucks/) (View Engine)

## Installation

Development Environment:

``` bash
  npm install
```

Production Environment:

``` bash
  npm install --production
```

## Running server (CLI options)

Setting Port to listen on (default=8080):

``` bash
  PORT=8080 npm start
```

Enabling Server logs (disabled by default):

``` bash
  DEBUG=IC npm start
```

Setting Environment (default=development):

``` bash
  NODE_ENV=<production|development> npm start
```

You can mix options, examples:

``` bash
  NODE_ENV=production PORT=80 DEBUG=IC npm start
```

## Your app in the browser

You can preview your app under [http://localhost:8080](http://localhost:8080) address unless you specified different port.

## Reload app while developing your app

The app doesn't reload itself. To avoid overhead with restarting the app manually every time you change your code, you can use [nodemon](https://github.com/remy/nodemon) tool. Simply run following commands:

``` bash
sudo npm install -g nodemon
```

In your app directory:
``` bash
DEBUG=IC nodemon ./bin/www
```

## Extending the application

### Extending Views

Since [Nunjucks](http://mozilla.github.io/nunjucks/) support [builtin filters](http://mozilla.github.io/nunjucks/templating.html#builtin-filters) as well as [custom filters](http://mozilla.github.io/nunjucks/api.html#custom-filters), you can roll out your own filters easily by creating JavaScript file in the `views/filters` directory.

``` javascript
  // Filename: views/filters/nl2br.js

  module.exports = function (nunjucks) {

    /**
     * Replaces all occurences of newline with <br> tags
     *
     *   Sample Usage:
     *
     *     {{ 'Hello\n\nWorld' | nl2br }} -> Hello<br><br>World
     *
     */
    return function (string) {
      return new nunjucks.runtime.SafeString(string.replace(/\n/g, '<br>'));
    }

  }
}
```

The code above would create `nl2br` filter that will be globally available in all your nunjucks templates. Filter is nothing else than the name of the file without extension, e.g. `nl2br.js -> nl2br`.


## Contributing
Feel free to contribute or contact me at <EMAIL> with any questions<commit_msg>Change text of the README slightly so that it's easier to understand.<commit_after># IC.js

InterCity.js - express.js-based, modular and lightweight NodeJS framework/structure

Main components:
* [Express.js](http://expressjs.com/) (HTTP Server)
* [Nunjucks](http://mozilla.github.io/nunjucks/) (View Engine)

## Installation

Development Environment:

``` bash
  npm install
```

Production Environment:

``` bash
  npm install --production
```

## Running server (CLI options)

Setting Port to listen on (default=8080):

``` bash
  PORT=8080 npm start
```

Enabling Server logs (disabled by default):

``` bash
  DEBUG=IC npm start
```

Setting Environment (default=development):

``` bash
  NODE_ENV=<production|development> npm start
```

You can mix options, examples:

``` bash
  NODE_ENV=production PORT=80 DEBUG=IC npm start
```

## Your app in the browser

You can preview your app under [http://localhost:8080](http://localhost:8080) address unless you specified different port.

## Reload app automatically every time you change the code

The app doesn't reload itself automatically. To avoid overhead with restarting the app manually every time you change your code, you can use [nodemon](https://github.com/remy/nodemon) tool. Simply run following commands:

``` bash
sudo npm install -g nodemon
```

In your app directory:
``` bash
DEBUG=IC nodemon ./bin/www
```

## Extending the application

### Extending Views

Since [Nunjucks](http://mozilla.github.io/nunjucks/) support [builtin filters](http://mozilla.github.io/nunjucks/templating.html#builtin-filters) as well as [custom filters](http://mozilla.github.io/nunjucks/api.html#custom-filters), you can roll out your own filters easily by creating JavaScript file in the `views/filters` directory.

``` javascript
  // Location: views/filters/nl2br.js

  module.exports = function (nunjucks) {

    /**
     * Replaces all occurences of newline with <br> tags
     *
     *   Sample Usage:
     *
     *     {{ 'Hello\n\nWorld' | nl2br }} -> Hello<br><br>World
     *
     */
    return function (string) {
      return new nunjucks.runtime.SafeString(string.replace(/\n/g, '<br>'));
    }

  }
}
```

The code above would create `nl2br` filter that will be globally available in all your nunjucks templates. Filter is nothing else than the name of the file without extension, e.g. `nl2br.js -> nl2br`.


## Contributing
Feel free to contribute or contact me at <EMAIL> with any questions
{'fraction_non_alphanumeric': 0.12067178104913955, 'fraction_numerical': 0.009537632179141614, 'mean_word_length': 3.968074150360453, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2028569', 'n_tokens_mistral': 1560, 'n_tokens_neox': 1422, 'n_words': 492}